You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android Studio中如何实现App重启后跳转至最近访问的Activity

书籍类安卓应用记忆上次退出页面的Manifest参考配置

使用Android Studio开发安卓应用时,若开发的是书籍类应用,往往需要实现应用重新打开后自动跳转至用户上次退出时停留页面的功能,对应的AndroidManifest.xml参考配置如下:

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/Theme.Demo4">
    <activity android:name=".MainActivity2"></activity>
    <activity android:name=".MainActivity"
        android:launchMode="singleTask">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

内容的提问来源于stack exchange,提问作者Krishna Game Studio

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.13 09:03:01