【问题标题】:Google Chrome ARC intent-filter crashGoogle Chrome ARC 意图过滤器崩溃
【发布时间】:2016-02-19 16:32:03
【问题描述】:

我尝试使用该代码从 ARC 上的意图过滤器实现启动应用程序:

<activity
        android:name=".package.etc.MyActivity"
        android:configChanges="mcc|mnc|locale|touchscreen|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|layoutDirection|fontScale"
        android:screenOrientation="sensorLandscape"
        android:launchMode="singleTask"
        android:label="@string/myactivity_name" >
        <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=".*\\.pdf" />
        <data android:host="*" />
    </intent-filter>
</activity>

在 Android 平板电脑上,它可以工作。但在 Chrome ARC 应用程序崩溃。 Chrome ARC 支持吗?

编辑

我遇到了崩溃

Fatal Exception: java.lang.IllegalArgumentException There is no Activity which handles filePath = file:///data/data/org.chromium.arc/external/C1373AC2527597D1C0BC66486DCC787F/Gra‌​nizo.pdf mimeType=application/pdf 

org.chromium.arc.helper.FileHandlerLaunchHelperActivity.buildLaunchIntent (FileHandlerLaunchHelperActivity.java:122)
org.chromium.arc.helper.FileHandlerLaunchHelperActivity.onMessage (FileHandlerLaunchHelperActivity.java:162)
org.chromium.arc.ArcMessageBridge$1.handleMessage (ArcMessageBridge.java:75)
org.chromium.arc.ArcMessageBridgeService$3.run (ArcMessageBridgeService.java:238)

编辑 2

<activity
    android:name="com.package.activities.MyActivity_"
        android:configChanges="mcc|mnc|locale|touchscreen|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|layoutDirection|fontScale"
    android:screenOrientation="sensorLandscape"
    android:launchMode="singleTask"
    android:label="@string/myactivity_name" >
    <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=".*\\.pdf" />
        <data android:host="*" />
    </intent-filter>
</activity>

【问题讨论】:

标签: android android-intent google-chrome-arc chromebook


【解决方案1】:

我将假设“ARC 文件资源管理器”是指通过 ARC 打包的其他 Android 应用程序,该应用程序在您的 Chrome/ChromeOS 环境中运行。

在这种情况下,该应用与您的应用无关。

最好将 ARC 视为为每个 ARC 提供单独的 Android 模拟器。一个 ARC 中的应用程序无法访问其他 ARC 中的应用程序,就像一个模拟器映像中的应用程序无法访问其他模拟器映像中的应用程序一样(或者一台设备上的应用程序无法访问另一台设备上的应用程序)。因此,您的“ARC 文件浏览器”在其自己的 ARC 中无法通过您的应用在单独的 ARC 中打开 PDF。

这使得许多 Android 应用程序在 ARC 环境中相当无用,希望将来会得到解决。

【讨论】:

    猜你喜欢
    • 2020-11-05
    • 2023-04-05
    • 1970-01-01
    • 2019-03-08
    • 2012-10-17
    • 1970-01-01
    • 2023-03-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多