Most of Users are not devloper. For any reason, their devices are enabled for “Don’t keep activities”option in developer option.
if device is enabled, the activity manager will aggressively finish activities and
processes as soon as they are no longer needed. accordingly, some functions may not work.
The following code snippet shows how you can detect your app’s the option enabled
public boolean isAlwaysFinishActivitiesEnabled(){ int state; if(Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1){ state = Settings.System.getInt( getContentResolver(), Settings.System.ALWAYS_FINISH_ACTIVITIES, 0 ); }else{ state = Settings.Global.getInt( getContentResolver(), Settings.Global.ALWAYS_FINISH_ACTIVITIES, 0 ); } return state != 0; }
0개의 댓글