简体   繁体   English

如何确保从家启动应用程序时启动器活动始终运行

[英]How to make sure that the launcher activity always run when the app is launched from the home

I have 2 activities in my app. 我的应用程序中有2个活动。 The A activity is the launcher one. A活动是启动器之一。 When I run the app the very first time, the launcher activity runs, but when I press the home button and restart the app from there by clicking the app icon, I always get the B activity running. 第一次运行应用程序时,启动器活动将运行,但是当我按下主屏幕按钮并通过单击应用程序图标从那里重新启动应用程序时,我总是使B活动运行。
I want to make sure that the activity A should always run when starting the app. 我想确保活动A在启动应用程序时始终运行。

This is the manifest code: 这是清单代码:

 <application
        android:icon="@drawable/icon"
        android:label="@string/app_name" >
        <activity
            android:name="com.velosys.smsManager.Activities.a"
            android:clearTaskOnLaunch="true"
            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.velosys.smsManager.Activities.b" />
</application>

I have searched a lot for this but did not get any clue. 我为此进行了很多搜索,但没有任何线索。

也许活动B上的android:launchMode =“ singleInstance”会完成它吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从“主页”按钮上显示的菜单中选择我的应用程序时,如何启动首选项活动? - How come the preferences activity is launched when selecting my app from the menu displayed when pressing the Home button? 从启动器图标启动应用程序时如何获取通知数据 - How to get notification data when the app launched from launcher icon 从启动器启动应用程序时,WebView会重置 - WebView resets when app is launched from launcher 再次启动应用程序时更改启动器活动 - Changing launcher activity when the app is launched second time onwards android 始终从启动器活动启动应用程序 - start app always from launcher activity 如何使发布活动始终作为家庭活动 - How to make launch activity always as home activity 从家庭启动时无法还原应用 - App is not being restored when launched from Home 单击启动器图标启动应用程序时,将调用启动器活动的onCreate() - onCreate() of Launcher activity gets called when app launched on clicking launcher icon 如何检查活动是从通知启动还是从用户单击 android 中的主屏幕仪表板应用程序图标启动 - how to check whether the activity was launched from notification or from the user click on home screen dashboard app icon in android 从通知退出应用程序中启动的活动中按下返回/主页 - Pressing back/home from activity launched in notification exits app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM