Java 将应用程序设置为主页将启动另一个实例
我想将我的应用程序设置为launcher(家庭应用程序),但有一些行为我无法纠正。首先,我打开应用程序并返回主屏幕,使其保持在后台。然后,当我在设置中设置home应用程序进行挖掘时,它会创建新实例。另外,当我回到“设置”中时,默认启动器应用程序似乎不会显示在正在运行的应用程序列表中。我不知道该怎么做,我尝试了不同的发射模式,但似乎没有帮助 这是我的清单文件Java 将应用程序设置为主页将启动另一个实例,java,android,ionic-framework,android-activity,kiosk-mode,Java,Android,Ionic Framework,Android Activity,Kiosk Mode,我想将我的应用程序设置为launcher(家庭应用程序),但有一些行为我无法纠正。首先,我打开应用程序并返回主屏幕,使其保持在后台。然后,当我在设置中设置home应用程序进行挖掘时,它会创建新实例。另外,当我回到“设置”中时,默认启动器应用程序似乎不会显示在正在运行的应用程序列表中。我不知道该怎么做,我尝试了不同的发射模式,但似乎没有帮助 这是我的清单文件 <?xml version='1.0' encoding='utf-8'?> <manifest android:hard
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="xxx" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:hardwareAccelerated="true" android:icon="@mipmap/icon" android:label="@string/app_name" android:supportsRtl="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:keepScreenOn="true" android:label="@string/activity_name" android:launchMode="singleTop" android:name="jk.cordova.plugin.kiosk.KioskActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
<intent-filter>
<action android:name="com.darryncampbell.cordova.plugin.intent.ACTION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<receiver android:name="jk.cordova.plugin.kiosk.MyPackageReplacedEventReceiver">
<intent-filter>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>
<provider android:authorities="${applicationId}.darryncampbell.cordova.plugin.intent.fileprovider" android:exported="false" android:grantUriPermissions="true" android:name="com.darryncampbell.cordova.plugin.intent.CordovaPluginIntentFileProvider">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths" />
</provider>
</application>
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="26" />
<uses-permission android:name="android.permission.REORDER_TASKS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
</manifest>
您将启动模式设置为singleTop。这意味着您只有一个实例位于堆栈顶部 文件 还可以创建“单顶”活动的新实例来处理新的意图。但是,如果目标任务的堆栈顶部已经有活动的现有实例,则该实例将接收新的意图(在onNewIntent()调用中);未创建新实例。在其他情况下-例如,如果“singleTop”活动的现有实例在目标任务中,但不在堆栈顶部,或者如果它在堆栈顶部,但不在目标任务中-将创建一个新实例并推送到堆栈上 您正在尝试的内容: 首先,我打开应用程序并返回主屏幕,使其保持在后台 我不认为发射器之间的最近的工作方式,你期望他们 然后,当我在设置中设置home应用程序进行挖掘时,它会创建新实例 是的,因为这是启动器,它启动了一个新的过程 另外,当我回到“设置”中时,默认启动器应用程序似乎不会显示在正在运行的应用程序列表中
最近的应用程序中不会显示启动器活动。显示您的maninfest@Blundell有问题的舱单。我的应用程序是基于ionic/cordova的,所以大部分都是由使用过的插件修改的。