API 19 Android中的OnNewIntent
我想恢复我的活动启动时的android意图 我的活动在API 19(KitKat)中进行了测试,除主要目的外,还有以下目的过滤器和参数:API 19 Android中的OnNewIntent,android,onnewintent,Android,Onnewintent,我想恢复我的活动启动时的android意图 我的活动在API 19(KitKat)中进行了测试,除主要目的外,还有以下目的过滤器和参数: android:alwaysRetainTaskState="false" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:screenOrientation="landscape" android:config
android:alwaysRetainTaskState="false"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="file" />
<data android:mimeType="*/*" />
<data android:pathPattern=".*\\.svg" />
<data android:host="*" />
</intent-filter>
与下面的参数结合起来,这就形成了6种配置
android:finishOnTaskLaunch="true" or "false"
但是当我用我的应用程序打开SVG时,没有一个函数可以调用onNewIntent
函数。相反,它显示以前的状态(按预期调用onPause和onResume,而调用onCreate)
我找到的唯一解决方法是使用onPause()
方法来校准finish()
函数,以便它有效地终止应用程序。我不明白发生了什么,因为在我改变目标之前,它在去年起作用
每次访问呼叫意图所需的配置是什么?
没有我的答案的相关问题:
- 说明我应该使用“singleTop”,但它在我的案例中不起作用
- 没有任何答案
- 描述意图的设置。但在我的情况下,我并不是自己创造意图的,安卓是这样做的
- 我的目标是安卓API 15。我放弃了19岁
- 我在
AndroidManifest.xml
- 我没有在
方法中调用onPause()
finish()
- 从不调用OnNewIntent,但会调用解析新意图的
方法onCreate
- 活动清单的内容如下所示:
<activity android:name="com.example.mypackage" android:launchMode="singleTop" android:finishOnTaskLaunch="true" android:alwaysRetainTaskState="false" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden|screenSize"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="file" /> <data android:mimeType="*/*" /> <data android:pathPattern=".*\\.svg" /> <data android:host="*" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
<activity
android:name="com.example.mypackage"
android:launchMode="singleTop"
android:finishOnTaskLaunch="true"
android:alwaysRetainTaskState="false"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="file" />
<data android:mimeType="*/*" />
<data android:pathPattern=".*\\.svg" />
<data android:host="*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>