anu_r
anu_r

Reputation: 1622

Why does activity keep on reloading after force close in android?

I have an Android Application which is integrated with Facebook. The activity Login has the code for Facebook integration.After successful Facebook login my next Fragment appears i.e the MainActivity. The problem is that when the app force closes the MainActivity relaunches itself again and again. Can anyone suggest a step by step solution for this? I am posting my manifest code below:

<activity android:name="com.smacon.task.Login" android:label="@string/app_name">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
<activity android:name="com.smacon.task.MainActivity" android:label="@string/app_name"
 android:launchMode="singleTask"/>

Upvotes: 3

Views: 177

Answers (1)

Robert
Robert

Reputation: 4830

This may be a long shot but could it be so that when your application closes and you're in your main activity, the close process goes through the activity stack and finnishes of activities one by one. When it enters your login activity your facebook login may then think you successed login and are valid to go to your next activity(MainActivity) and so on. Once again this is a long shot but easy to test, in your manifest add android:noHistory="true" to your Login activity, that should prevent your application from entering your login activity again. Just to test this theory.

Upvotes: 2

Related Questions