2012-08-13 165 views
1

IM有一个奇怪的问题,而不是在那里一个URL应该启动我的应用程序,它加载应用程序到浏览器本身,在这种情况下进入mozella!Android 4.0的启动应用程序无法正常工作

这里是意图过滤器我用我的应用程序如果有人能告诉我什么即时做错了。

<uses-sdk android:minSdkVersion="15" /> 
<uses-permission android:name="android.permission.INTERNET"/> 
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 

<application 
    android:name=".Globals" 
    android:icon="@drawable/ic_launcher" 
    android:label="@string/app_name" > 
    <activity 
     android:name=".RSS_ViewerActivity" 
     android:label="@string/app_name" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 

     <intent-filter> 
       <action android:name="android.intent.action.VIEW" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
       <data android:scheme="itpc" /> 
       <data android:scheme="pcast" /> 
       <data android:scheme="feed" /> 
       <data android:scheme="feeds" /> 
       <data android:scheme="rss" /> 
     </intent-filter> 

     <intent-filter> 
       <action android:name="android.intent.action.VIEW" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
       <data android:mimeType="text/xml" android:scheme="http" /> 
       <data android:mimeType="application/rss+xml" android:scheme="http" /> 
       <data android:mimeType="application/atom+xml" android:scheme="http" /> 
       <data android:mimeType="text/xml" android:scheme="https" /> 
       <data android:mimeType="application/rss+xml" android:scheme="https" /> 
       <data android:mimeType="application/atom+xml" android:scheme="https" /> 
     </intent-filter> 

    </activity> 
    <activity android:name="RSSFeedActivity"></activity> 
    <activity android:name="com.CertificateAuthentication.Authenticator"></activity> 
</application> 

谢谢。

UPDATE

稍微多一些的信息,当对话框,询问是否要选择和应用,以打开弹出链接起来,它并不曾显示我的应用程序,或任何与此有关。

UPDATE

我删除了第二和第三意图过滤器,我试图将2个其余意图过滤器合并成1,但是这不加载来自浏览器的应用程序。上面的代码是什么样子现在让我相同的结果=前(这是烦人的,因为它意味着用户可以在应用程序运行的2次会议,一个从浏览器和一个从发射器。

回答

0

你第二和第三<intent-filter>元素可能无法正常工作,因为android:host未记录支持通配符。这里

+0

干杯但是,不幸的是没有工作=( 我试图改变动作为主,但不工作的对话框,询问是否要选择一个应用程序犯规不断显示我的应用程序! – 2012-08-13 13:44:15

0

问题是\,这是转义字符,所以让你需要\\这个表达式的工作。 Documentation clearly says,你需要使用\\.为点(有例如用\\*)。

我也同意CommonsWare答案,我在documentation这样的表述已经发现:

所有这些属性是可选的,但它们不是独立的 对方:对于权力是有意义的,一个方案还必须指定 。为了使路径有意义,必须指定方案和权威 。

而且The host and port together constitute the URI authority所以在实践中权力意味着主机所以你不能省略,显然你不能把一个明星出现。

IMO你让它变得复杂,你不需要在这里定义路径! MIME类型应该做这项工作。尝试找到一些读取RSS的开源项目,看看他们如何定义清单。

我想你需要类似的东西:

<activity 
    android:name=".RSS_ViewerActivity" 
    android:label="@string/app_name" > 
    <intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 

     <category android:name="android.intent.category.LAUNCHER" /> 
    </intent-filter> 

    <intent-filter> 
     <action android:name="android.intent.action.VIEW" /> 
     <category android:name="android.intent.category.BROWSABLE" /> 
     <category android:name="android.intent.category.DEFAULT" /> 
     <data android:scheme="itpc" /> 
     <data android:scheme="pcast" /> 
     <data android:scheme="feed" /> 
     <data android:scheme="feeds" /> 
     <data android:scheme="rss" /> 
     <data android:mimeType="text/xml" android:scheme="http" /> 
     <data android:mimeType="application/rss+xml" android:scheme="http" /> 
     <data android:mimeType="application/atom+xml" android:scheme="http" /> 
     <data android:mimeType="text/xml" android:scheme="https" /> 
     <data android:mimeType="application/rss+xml" android:scheme="https" /> 
     <data android:mimeType="application/atom+xml" android:scheme="https" /> 
    </intent-filter> 

</activity> 
+0

感谢您的帮助,我拿出那些2个意图过滤器,你和commonsware的建议,我已经更新了我上面的帖子。 我仍然会得到相同的结果,虽然=(我也尝试过从另一个浏览器,股票安卓一,我得到的应用程序的相同结果从浏览器查看,而不是启动/恢复,如果它是运行。 – 2012-08-14 08:25:34

相关问题