0

I try to implement launch app from intent filter on ARC using that code :

<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>

On Android Tablet, it works. But on Chrome ARC app crashes. Is Chrome ARC supports that ?

EDIT

I got that crash

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)

EDIT 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>
Florian Mac Langlade
  • 1,863
  • 7
  • 28
  • 57

1 Answers1

0

I am going to assume that whatever "ARC file explorer" is refers to some other Android app, packaged via ARC, that is running in your Chrome/ChromeOS environment.

In that case, that app has nothing to do with your app.

It is best to think of ARC as providing separate Android emulators per ARC. Apps in one ARC do not have access to apps in other ARCs, just as apps in one emulator image do not have access to apps in other emulator images (or apps on one device do not have access to apps on a separate device). Hence, your "ARC file explorer", in its own ARC, cannot open a PDF via your app in a separate ARC.

This makes many Android apps fairly useless in the ARC environment, and hopefully is something that will be addressed in the future.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491