Android应用列表中显示的Android两项活动

时间:2014-08-06 04:15:47

标签: android android-activity

我有片段的MainActivity片段包含ListView当用户点击列表项时打开新的活动说PostActivity,当我按最近的按钮拖动活动显示在最近的应用程序列表中。 如何在没有完成()MainActivity的情况下解决这个问题?

活动是NewMainActivity和SinglePostActivity:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.ovtraining.wordpressapp"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="7"
    android:targetSdkVersion="19" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>


<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="net.ovtraining.wordpressapp.SplashScreen"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="net.ovtraining.wordpressapp.NewMainActivity"
        android:label="@string/app_name"
        android:launchMode="singleInstance" >
    </activity>
    <activity
        android:name="net.ovtraining.wordpressapp.LanguageSelectionActivity"
        android:label="@string/app_name" >
    </activity>
    <activity
        android:name="net.ovtraining.wordpressapp.SettingsActivity"
        android:label="@string/app_name"
        android:parentActivityName="net.ovtraining.wordpressapp.MainActivity" >
    </activity>
    <activity
        android:name="net.ovtraining.wordpressapp.ui.SinglePostActivity"
        android:label="@string/app_name"
        android:parentActivityName="net.ovtraining.wordpressapp.MainActivity" >
        <meta-data 
            android:name="android.support.PARENT_ACTIVITY"
            android:value="net.ovtraining.wordpressapp.MainActivity" />
    </activity>
</application>

1 个答案:

答案 0 :(得分:0)

您可以在定义活动android:excludeFromRecents="true"

的清单中添加此内容

例如

<activity 
android:name=".MyActivity"
android:excludeFromRecents="true">