2016-02-19 168 views
0

我尝试使用代码来实现对ARC从意图过滤器推出应用:谷歌浏览器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) 

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

LogCat显示你什么? – CommonsWare

+0

在chromebook上看不到logcat –

+0

您当然可以。请参阅http://stackoverflow.com/a/29451047/115145和http://stackoverflow.com/a/29564350/115145和http://stackoverflow.com/a/32951857/115145 – CommonsWare

回答

0

我要承担,无论 “ARC文件浏览器” 是指其他一些通过ARC打包的Android应用在Chrome/ChromeOS环境中运行。

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

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

这使得许多Android应用程序在ARC环境中毫无用处,并且希望未来能够解决这些问题。