Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/rest/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 更改历史堆栈中活动的意图数据_Android_Android Intent_Back Stack_Android Navigation - Fatal编程技术网

Android 更改历史堆栈中活动的意图数据

Android 更改历史堆栈中活动的意图数据,android,android-intent,back-stack,android-navigation,Android,Android Intent,Back Stack,Android Navigation,我有一个可以处理“.arr”文件的应用程序。为此,我在AndroidManifest中添加了适当的参数: <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:scheme="file" android

我有一个可以处理“.arr”文件的应用程序。为此,我在AndroidManifest中添加了适当的参数:

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="file" android:host="*" android:pathPattern=".*\\.arr" android:mimeType="*/*"/>
</intent-filter>
问题在于,在历史堆栈中,它将意图与其数据(文件)一起保存。因此,如果我关闭我的应用程序并从历史记录中重新打开它,它会再次检测到好像我正在再次打开文件


我想将应用程序保留在历史堆栈中,但不包含文件信息

(更像是黑客而不是解决方案)您可以在SharedReferences中保存上次打开的文件的名称,在调用时检查它是否存在,并根据该名称进行设置…(更像是黑客而不是解决方案)您可以在SharedReferences中保存上次打开的文件的名称,在调用时检查它是否存在,然后根据该名称进行设置。。。
Uri uri = intent.getData();