我正在编写一个应用程序,遇到了一个问题。我有三个活动A、B和C。当我从活动A到B,再从B到C时,如果我按设备上的菜单按钮,我的应用程序就会进入后台状态。当我重新打开应用程序时,它会显示活动C。我想要的是,当我重新打开应用程序时,它应该显示活动A,而不是来自活动堆栈中的任何其他活动。
我已经查看了一些活动生命周期方法并尝试重写它。我已经重写了onStart()、onPause()方法,并完成了Activity C以及Activity B,但我面临的问题是当我从Activity C到Activity D时,Activity C完成所有后台活动,我无法返回到Activity C。
有人能帮助我如何在应用程序恢复时显示特定的活动吗?
以下是我的manifest.xml:
我已经查看了一些活动生命周期方法并尝试重写它。我已经重写了onStart()、onPause()方法,并完成了Activity C以及Activity B,但我面临的问题是当我从Activity C到Activity D时,Activity C完成所有后台活动,我无法返回到Activity C。
有人能帮助我如何在应用程序恢复时显示特定的活动吗?
以下是我的manifest.xml:
<uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
<activity
android:label="@string/app_name"
android:name="com.buttonpay.Login"
android:screenOrientation="portrait"
android:clearTaskOnLaunch="true" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ButtonPayActivity"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:screenOrientation="portrait"/>
<!-- HomeTab Activity -->
<activity android:name="com.buttonpay.home.Utilities"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:screenOrientation="portrait"/>
<activity android:name="com.buttonpay.home.Top_up"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:screenOrientation="portrait"/>
<activity android:name="com.buttonpay.home.HomeScreen"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:screenOrientation="portrait"/>
<activity android:name="com.buttonpay.home.MyAccount"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:screenOrientation="portrait"/>
<activity android:name="com.buttonpay.home.TransactionHistory"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:screenOrientation="portrait"/>
<activity android:name="com.buttonpay.home.TransactionDetailsActivity"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:screenOrientation="portrait"/>
<activity android:name="com.buttonpay.home.TransactionList"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:screenOrientation="portrait"/>
<activity android:name="com.buttonpay.home.BusinessSummaryActivity"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:screenOrientation="portrait"/>
<activity android:name=".home.MobileMoneyActivity"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:screenOrientation="portrait"/>
<!-- balance tab Activity -->
<activity android:name="com.buttonpay.balance.BalanceTab"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
/>
<!-- Favouritetab Activity -->
<activity android:name="com.buttonpay.favourite.FavouriteTab"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
/>
<!-- ComingSoon -->
<activity android:name="com.buttonpay.home.ComingSoon"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:screenOrientation="portrait"/>
<!-- Settings -->
<activity android:name="com.buttonpay.settings.SettingList"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:screenOrientation="portrait"/>
</application>