0

I have three activities in my app:

  1. .OpeningScene: An opening activity that contains my logo, business info, copyright, etc. and a start button that launches the intent to move to the next activity
  2. .hfmain: This in the main app activitty with a help button, that launches the intent to the last activity, which is a help screen
  3. .helpscreen: The help screen has simple instructions and a back button to return the user to the main app activity (.hfmain)

Here is my issue. The first time I enter the app, the opening activity is launched from the icon as it should, but if I leave the application and come back to the icon to start the app again, the application picks up in the activity where it was left. I know this is part of the life cycle, but why isnt the opening activity for the launcher being called each time the icon is clicked?

Here is my manifest:

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".OpeningScene"
        android:label="@string/app_name"
        android:screenOrientation="portrait" 
        >
        <intent-filter>
            <action android:name="android.intent.action.INTROSCENE" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".hfmain"
        android:screenOrientation="portrait" />
    <activity android:name=".helpscreen"
        android:screenOrientation="portrait" />
</application>
Oak Bytes
  • 4,649
  • 4
  • 36
  • 53
DataGuy
  • 1,695
  • 4
  • 22
  • 38
  • Please see: [force application to restart on first activity](http://stackoverflow.com/questions/2470870/force-application-to-restart-on-first-activity-android) – Tushar Jun 07 '12 at 14:52

2 Answers2

0

Try with this

<intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
Aerrow
  • 12,086
  • 10
  • 56
  • 90
  • Thanks for the feedback on the rating. I wasnt even aware! Just to clarify, must the opening activity xml be named MAIN? – DataGuy Jun 07 '12 at 15:52
  • @user890803: check this link for more info reg intent-filter http://developer.android.com/guide/topics/intents/intents-filters.html – Aerrow Jun 07 '12 at 16:46
0

if you really want to end the app, try to use finish() in the onPause() method. But imho you shouldn't change or avoid the lifecycle so much.

See also: Force application to restart on first activity

Community
  • 1
  • 1
Thkru
  • 4,218
  • 2
  • 18
  • 37