Can I be sure that the Android application has finished working by checking isFinish () for basically Activity onPause ()?

I need to clear some application data after completing my application. As far as I know, onDestroy()it cannot be called. Therefore, I decided to check if there is isFinishing() == truea onPause()root activity to see if this activity is running and my other applications. But I doubt that this activity:

  <activity
        android:name="com.test.AuthorizationActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

what is the root activity? And is this the right way at all?

+5
source share
3 answers

, , , isFinishing , finish , - .

:

, (- finish() , , , . isFinishing().

, , static, , ( / ).

+1

, onDestroy ? onDestroy , , Android docs.

, ?

: , . , .

0

onDestroy() . , , , , .

0

All Articles