gpt4 book ai didi

java - 当我运行应用程序时它会重新启动我的应用程序

转载 作者:太空宇宙 更新时间:2023-11-04 11:28:55 26 4
gpt4 key购买 nike

我正在开发一个 Android 项目,我有一个关于 Activity 的问题:从 android studio 运行:当我运行应用程序时,它会启动到最后一个 Activity (这就是我想要的)。

A -> B ->首页 -> B

但是从 APK :它启动第一个 Activity,并且位于我最后一个 Activity 的顶部

A -> B ->首页 -> A

我希望我的 apk 执行与我从 android studio 安装应用程序时相同的操作。

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.alloairport"
android:versionCode="7"
android:versionName="1.0.2">

<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="23" />

<uses-permission android:name="android.permission.CALL_PHONE" />
<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" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />

<!-- GCM permissions -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.VIBRATE" />

<permission
android:name="com.alloairport.permission.C2D_MESSAGE"
android:protectionLevel="signature" />

<uses-permission android:name="com.hub4.gcm.permission.C2D_MESSAGE" />

<application
android:name=".application.Hub4Drivers"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
>
<activity
android:name=".drivers.ui.activity.SplashActivity"
android:configChanges="orientation|keyboard|keyboardHidden"
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=".drivers.ui.activity.TestActivity" />
<activity android:name=".drivers.ui.activity.PrefActivity" />
<activity android:name=".drivers.ui.activity.MainActivity" />
<activity
android:name=".drivers.ui.activity.LoginActivity"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".drivers.ui.activity.HomeActivity"
android:alwaysRetainTaskState="true"
android:exported="true">

</activity>

<activity android:name=".drivers.ui.activity.AlloairportHomeActivity" />
<activity android:name=".drivers.ui.activity.HomeConcentratorActivity" />
<activity android:name=".modules.message.ListOfMessageActivity" />
<activity android:name=".modules.message.MessageActivity" />
<activity android:name=".modules.message.SendMessageActivity" />
<activity android:name=".modules.webform.WebFormActivity" />
<activity android:name=".modules.blacklist.FilterActivity" />
<activity android:name=".drivers.ui.activity.SuggestRaceActivity" />
<activity android:name=".drivers.ui.activity.RaceRecordActivity" />
<!-- activity android:name="com.hub4.drivers.ui.activity.NewRaceActivity" / -->
<activity
android:name=".drivers.ui.activity.NewRaceActivity"
android:label="@string/app_name">
<intent-filter>
<category android:name="android.intent.category.INFO" />
</intent-filter>
</activity>
<!-- <activity android:name="com.hub4.drivers.ui.activity.ParserTestActivity" /> -->
<activity android:name=".drivers.ui.activity.RaceToAssignActivity" />
<activity android:name=".drivers.ui.activity.DriverInformationActivity" />
<activity android:name=".drivers.ui.activity.NewRacePropositionActivity" />
<activity
android:name=".drivers.ui.activity.SuggestRaceDriverActivity"
android:windowSoftInputMode="stateHidden" />
<activity android:name=".drivers.ui.activity.driver.DriverAppliedRaceActivity" />
<activity
android:name=".drivers.ui.activity.driver.DriverAssignRaceActivity"
android:theme="@style/noAnimTheme" />
<activity android:name=".drivers.ui.activity.driver.DriverHistoryRaceActivity" />
<activity
android:name=".drivers.ui.activity.driver.DriverNewRaceActivity"
android:alwaysRetainTaskState="true"
android:exported="true"/>
<activity android:name=".drivers.ui.activity.driver.DriverRaceSentActivity" />
<activity android:name=".drivers.ui.activity.list.DriverAsgRaceListActivity" />
<activity android:name=".drivers.ui.activity.list.DriverHistRaceListActivity" />
<activity android:name=".drivers.ui.activity.list.DriverMyAppListActivity" />
<activity android:name=".drivers.ui.activity.list.DriverNewRaceListActivity" />
<activity android:name=".drivers.ui.activity.list.DriverRaceSentListActivity" />

最佳答案

在家庭 Activity 中完成任务后,只需完成家庭 Activity 即可。即

finish();

关于java - 当我运行应用程序时它会重新启动我的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44026659/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com