0

in my android application 3 activities are there.those are A,B&C. Initial landing screen is A.then navigate to B. But I want to display Activity C when this app is in recent appslist kind of App Masking. Any one have idea please share me. Thanks in Advance!!!

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Pinki
  • 21,723
  • 16
  • 55
  • 88

3 Answers3

1

Well it's easy you can use the savedInstanceState Bundle to save a boolean flag(lest say isAppCameFromRecent) in onSavedInstanceState method when app minimised then use onRestoreInstanceState to extract that boolean when app returns from recent apps list if boolean is set to true then navigate to activity C.

@

Override
    public void onSaveInstanceState(Bundle savedInstanceState) {
     super.onSaveInstanceState(savedInstanceState); 
     ...
    }

@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
  super.onRestoreInstanceState(savedInstanceState);
...
}
Umer Khan
  • 486
  • 2
  • 11
  • I want to display another screen when we look the app in recent apps list if we open the app I want normal behaviour kind of App Mask screen – Pinki Nov 20 '17 at 11:03
0

you can StartActivity C Activity in onResume of A Or B activity.

Pratik18
  • 365
  • 1
  • 7
0

Use ActivityLifecycleCallbacks check in on resume check weather your Activity exits in ActivityManager.

Sohail Zahid
  • 8,099
  • 2
  • 25
  • 41
  • i have started another activity at onpause even though that layout not visible at recent apps.New layout is visible after open the app, But i want to change the UI when app is in recent apps(cards view) – Pinki Nov 19 '17 at 06:56