[問題] 靜態activity不能連接uri?

看板AndroidDev作者 (皮老闆)時間12年前 (2013/07/31 20:08), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/1
我用一個靜態activity來存取this, private static Activity act=null; onCreate() { act = this; } 然後用一個靜態方法來開啟瀏覽器 public static void linkToWeb() { Intent i = new Intent(Intent.ACTION_VIEW,Uri.parse("www.google.com")); me.startActivity(i); } 出現No Activity found to handle Intent....的訊息 該如何改寫? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.33.207.109

07/31 21:58, , 1F
網址前面要加 http/https 系統才會知道要呼叫瀏覽器
07/31 21:58, 1F

07/31 22:48, , 2F
感謝
07/31 22:48, 2F
文章代碼(AID): #1H-FuXzZ (AndroidDev)