我需要知道如何製作一個按鈕,打開androids網頁瀏覽器並導航到特定的URL。我正在使用eclipse,並已知道如何製作按鈕並單擊偵聽器。 感謝您的幫助。如何製作一個按鈕,在eclipse中作爲android的鏈接
-1
A
回答
1
Intent websiteIntent = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.parse("http://www.android.com");
websiteIntent.setData(uri);
startActivity(websiteIntent);
2
就在這個代碼添加到的onClick():
// Launch a browser
Uri uri = Uri.parse("http://www.yahoo.com");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
1
試試這個
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com");
startActivity(intent);
相關問題
- 1. 如何在android中設置按鈕作爲超鏈接
- 2. 如何使按鈕在erb中作爲鏈接工作?
- 3. Struts2鏈接作爲按鈕
- 4. 在asp.net中製作一個超鏈接按鈕
- 5. 製作一個SWF文件到一個可鏈接的按鈕
- 6. 如何爲按鈕製作邊框? (ANDROID)
- 7. 製作一個按鈕打開一個超鏈接
- 8. 如何製作到另一頁的按鈕鏈接?
- 9. 如何製作具有鏈接的多個按鈕?
- 10. 結合Next和Forward功能作爲一個按鈕在Android eclipse
- 11. 如何使(鏈接)按鈕功能作爲超鏈接?
- 12. 創建一個HTML按鈕與Onlick作爲一個鏈接?
- 13. 如何在鏈接中有一個不是鏈接的按鈕
- 14. 如何製作一個按鈕鏈接到另一個html頁面?
- 15. 如何在vaadin中顯示按鈕作爲鏈接
- 16. 在eclipse中製作圓形按鈕
- 17. 製作按鈕鏈接 - 使用Javascript
- 18. 製作按鈕超鏈接Swift
- 19. 在sapui5中導航另一個URL鏈接的按鈕動作
- 20. 我如何製作一個按鈕作爲設置壁紙按鈕?
- 21. 如何在Facebook上製作按鈕鏈接?
- 22. 製作一個可點擊鏈接按鈕
- 23. 你如何製作一個按鈕鏈接到可可的網站?
- 24. 如何使一個PayPal按鈕的工作作爲一個提交按鈕
- 25. 在ASP中製作一個超鏈接
- 26. 製作一個按鈕類
- 27. 鏈接按鈕動作
- 28. 如何製作一個直接擴展演員的按鈕? Libgdx
- 29. 按鈕作爲鏈接,通過參數
- 30. PayPal按鈕作爲文字鏈接