how to check if activity is still in the stack?

前端 未结 3 528
天涯浪人
天涯浪人 2021-01-12 14:05

what is the better way to check if the activity is still in the stack in order to call it back ?

Intent i = new Intent(getApplicationContext(),MyClass.class)         


        
3条回答
  •  萌比男神i
    2021-01-12 14:25

    Look at the ActivityManager API

    To get an instance of the ActivityManager use this code:

    ActivityManager mngr = (ActivityManager) getSystemService( ACTIVITY_SERVICE );
    

提交回复
热议问题