onResume()仅在应用程序通过启动器图标启动时才起作用,而不是在安装时按下打开按钮 [英] onResume() works only when app launched through launcher icon other than by pressing open button when installing

查看:92
本文介绍了onResume()仅在应用程序通过启动器图标启动时才起作用,而不是在安装时按下打开按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友,

从apk文件安装我的应用程序复制到SD卡安装后单击打开按钮打开它。

在这种情况下,如果用户点击使用应用程序时的主页按钮,并使用启动器图标重新打开应用程序,上次查看的屏幕未显示。相反,它从登录页面开始。此应用未在最近的应用列表下列出。这是我的清单文件:

Hi Friends,
Install my app from apk file copied to sd card Open it by clicking "open" button after installation.
In this scenario, if user clicks home button when using the app and reopens the app by using launcher icon, last viewed screen is NOT showing up. Instead it starts from login page. Also app not listed under Recent Apps list. Here is my manifest file:

    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
    <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
    <uses-permission android:name="android.permission.CLEAR_APP_CACHE" />

    <application

        android:clearTaskOnLaunch="true"

        android:excludeFromRecents="true"

        android:icon="@drawable/icon"

        android:label="@string/app_name"

        android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen" >
        <activity

            android:name="com.riyamobile1.android.MainActivity"

            android:clearTaskOnLaunch="true"

            android:excludeFromRecents="false"

            android:label="@string/app_name"

            android:noHistory="false" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        
        <activity

            android:name="com.riyamobile1.android.FlightSearchActivity"

            android:configChanges="orientation|keyboardHidden"

            android:windowSoftInputMode="adjustPan" />
        <activity android:name="com.riyamobile1.android.FlightSearchActivityy" />
 
</manifest>

推荐答案

问题是(我猜)android:clearTasksOnLaunch,因为

来自developer.android的描述
除了根活动之外,是否所有活动都将从任务中移除,无论何时从家中重新启动
The problem is (I guess) android:clearTasksOnLaunch, because
the description from developer.android
Whether or not all activities will be removed from the task, except for the root activity, whenever it is re-launched from the home


这篇关于onResume()仅在应用程序通过启动器图标启动时才起作用,而不是在安装时按下打开按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆