Skip to content Skip to sidebar Skip to footer

Get Extras In Single Instance Mode

I want to put some extras with putextras(,) in notification , but my activity is in Single Instance Mode and in OnResume I can not get any extras . how can I solve this problem ?

Solution 1:

onsaveinstancestate you can save your data. onrestoreinstancestate you can retrieve. these always call when activity goes on pause or resume.

@OverridepublicvoidonSaveInstanceState(Bundle savedInstanceState) {
      savedInstanceState.putExtra("keyboard", false);
      super.onSaveInstanceState(savedInstanceState);
    }

   @OverridepublicvoidonRestoreInstanceState(Bundle outbundle) {
      outbundle.getBooleanExtra("keyboard", true);
      super.onSaveInstanceState(outbundle);
    }

Solution 2:

I think you need to implement the onNewintent() method for Activity

Post a Comment for "Get Extras In Single Instance Mode"