savedInstanceState returning null

后端 未结 3 1842
长发绾君心
长发绾君心 2021-01-06 18:04

Can someone please explain why the value in my savedInstanceState is null? I have 3 widgets, an EditText, Button and TextView. The person types in what they want. The Phrase

3条回答
  •  再見小時候
    2021-01-06 18:21

    Use below code it works for me.

     @Override
        protected void onSaveInstanceState(Bundle outState) {
            super.onSaveInstanceState(outState);
            outState.putString("example",newString);
        }
    

提交回复
热议问题