0
Possible Duplicate:
How can I open a URL in Android’s web browser from my application?
Start the android browser如何在主要活動中調用默認瀏覽器?
我檢查了一些參考我使用下面的代碼在主要活動中調用默認瀏覽器。
Intent intent= new Intent();
intent.setAction("android.intent.action.VIEW");
Uri content_url = Uri.parse("www.baidu.com");
intent.setData(content_url);
intent.setClassName("com.android.browser","com.android.browser.FMSActivity");
startActivity(intent);
然後修改XML:
<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" />
</intent-filter>
但我得到的日誌錯誤:
12-21 05:54:56.367: E/AndroidRuntime(277): at sz.zd.SzActivity.onCreate(SzActivity.java:19)
如何調用默認瀏覽器的主要活動?
什麼是SzActivity.java:19線在SzActivity活動? –
[相關](http://stackoverflow.com/questions/2201917/how-can-i-open-a-url-in-androids-web-browser-from-my-application) – Renjith
意圖過濾器不屬於在您的應用程序(而不是瀏覽器)中,除非您希望自己的應用程序響應有問題的意圖。 – Tapirboy