launcher activity market bug fixed
This commit is contained in:
parent
dff8fd1703
commit
b0dc24d554
|
|
@ -1,6 +1,7 @@
|
|||
package ru.touchin.roboswag.components.navigation.activities;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
|
|
@ -35,9 +36,25 @@ public abstract class BaseActivity extends AppCompatActivity
|
|||
return resumed;
|
||||
}
|
||||
|
||||
protected boolean isLauncherActivity() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// Possible work around for market launches. See http://code.google.com/p/android/issues/detail?id=2373
|
||||
// for more details. Essentially, the market launches the main activity on top of other activities.
|
||||
// we never want this to happen. Instead, we check if we are the root and if not, we finish.
|
||||
if (isLauncherActivity() && !isTaskRoot()) {
|
||||
final Intent intent = getIntent();
|
||||
if (intent.hasCategory(Intent.CATEGORY_LAUNCHER) && Intent.ACTION_MAIN.equals(intent.getAction())) {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
isCreatedSubject.onNext(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue