Android activity recreate itself

后端 未结 13 1669
攒了一身酷
攒了一身酷 2021-02-05 07:06

My app normally works just fine, until I face a strange problem on specific device. There are 2 activities in App. After I start ActivityB inside of ActivityA, ActivityA starts

13条回答
  •  面向向阳花
    2021-02-05 07:29

    You can try one thing provide your layout in onCreate() and do the rest of the work in onStart() ?? if it works??

    LIKE:

     public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.show);
       }
    

    and

          @Override
           protected void onStart() {
           // TODO Auto-generated method stub
        super.onStart();
        Log.i(TAG, "On Start .....");
    
          }
    

    See Activity Lifecycle enter image description here

提交回复
热议问题