【发布时间】:2016-08-12 18:00:22
【问题描述】:
我正在开发一个启动器应用程序。当我在启动器上并按下 home 键时,该活动将动画化并打开该活动的一个新实例。按 home 键时,我该怎么做才能保持主屏幕活动?
<application
android:name=".BaseApplication"
android:allowBackup="true"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity"
android:launchMode="singleInstance"
android:excludeFromRecents="true"
android:windowSoftInputMode="adjustPan"
android:screenOrientation="sensorPortrait"
android:configChanges="orientation|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
...
【问题讨论】:
标签: android homescreen android-launcher android-homebutton