savedInstanceState is always null

前端 未结 13 2200
星月不相逢
星月不相逢 2020-11-29 00:53

This is my savedInstaceState code:

@Override
public void onSaveInstanceState(Bundle savedInstanceState) 
{
    savedInstanceState.putStringArrayList(\"todo_a         


        
13条回答
  •  孤城傲影
    2020-11-29 01:41

    How do you test it?

    Imo the best way to test it is using the "Don't keep activities"-flag in Settings > Developer Options. If you don't have Developer Options in Settings, see Enabling On-device Developer Options.

    1. Open your activity
    2. Long-press home
    3. Go to another application
    4. Long-press home
    5. Go back to your application

提交回复
热议问题