2011-11-27 49 views
0

我試圖使用意圖過濾器在我的應用程序中打開URL(因爲開放http://market.android.com/打開Android電子市場)。可瀏覽的意圖過濾器無法打開我的應用程序

根據文檔我發現,有了這個代碼,在瀏覽器中打開http://seenthis.net/people/progval應該打開我的應用程序:

<activity android:name=".ShowUserActivity" android:permission="android.permission.INTERNET"> 
     <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="http" 
       android:host="seenthis.net" 
       android:pathPattern="/people/.*" /> 
     </intent-filter> 
    </activity> 

但事實並非如此。

這裏的活動:

public class ShowUserActivity extends ListActivity { 
    @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     Log.d("SeenDroid", "called"); 
     String url = getIntent().getDataString(); 
     if (url != null) { 
      Log.d("SeenDroid", url); 
     } 
     // ... 
    } 
    // ... 
} 

但沒有記錄到logcat的。

問候, ProgVal

回答

2

您需要從activity聲明刪除android:permission="android.permission.INTERNET"

相關問題