в моем приложении 3 страницы есть
1 разбрызгивание
2-Логин
3-OTPpage
В заставке одни и те же значения отправляются на страницу входа методом putextra.
но страница входа в систему открывается дважды, поэтому при добавлении кнопки «Назад» для System.exit(0)
страница входа снова открывается,
поэтому я добавляю android:launchMode="singleTask"
в манифест, после добавления этой строки значение передачи нерегулярно меняется, что я должен делать .. Есть ли какой-либо другой метод, чтобы предотвратить повторное создание деятельности
код активности
@Override
protected void onResume() {
super.onResume();
// The first time mTimeBeforeDelay will be 0.
long gapTime = System.currentTimeMillis() - mTimeBeforeDelay;
if (gapTime > SPLASH_SCREEN_MS) {
gapTime = SPLASH_SCREEN_MS;
}
mSplashHandler.postDelayed(new Runnable() {
@Override
public void run() {
if (sharedPreferences.getBoolean("first_time", true)) {
if (isConnectingToInternet()) {
frstrequest();
} else {
ViewDialog1 alert = new ViewDialog1();
alert.showDialog(Splash.this, "Make Sure Internet is Connected", R.drawable.no_internet);
}
} else {
Intent i = new Intent(getApplicationContext(), ApplockActivity.class);
startActivity(i);
overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit);
Splash.this.finish();
}
}
}, gapTime);
// Save the time before the delay.
mTimeBeforeDelay = System.currentTimeMillis();
}
@Override
protected void onPause() {
super.onPause();
mSplashHandler.removeCallbacksAndMessages(null);
}
манифест
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".Splash"
android:screenOrientation="portrait">
</activity>
<activity
android:name=".LoginActivity"
android:noHistory="true"
android:screenOrientation="portrait">
</activity>
<activity