0
私は、暗黙インテントを使用してブラウザ内でリンクを開くために、Courseraの割り当てに取り組んでいます。コード内には、使用したいブラウザのオプションを与える選択メソッドがあります。しかし問題は、CATEGORY Browsableオプションを使用してブラウザが表示されないことです。 (何のブラウザが出てくるんなぜ私は理解していない)ブラウザ内でリンクを開く意図がありません
private void startImplicitActivation() {
Log.i(TAG, "Entered startImplicitActivation()");
// TODO - Create a base intent for viewing a URL
// (HINT: second parameter uses Uri.parse())
String url = "https://www.google.com";
Intent baseIntent = new Intent(Intent.CATEGORY_BROWSABLE, Uri.parse(url));
// TODO - Create a chooser intent, for choosing which Activity
// will carry out the baseIntent
// (HINT: Use the Intent class' createChooser() method)
Intent chooserIntent = new Intent(Intent.createChooser(baseIntent, "Select Your Browser"));
Log.i(TAG,"Chooser Intent Action:" + chooserIntent.getAction());
// TODO - Start the chooser Activity, using the chooser intent
startActivity(chooserIntent);
}
活動に発売された出力は以下の通りです:私のコードを見てください
が
[特定のURLを開くためのブラウザへのインテントの送信](http://stackoverflow.com/questions/3004515/sending-an-intent-to-browser-to-open-specific-url) – AxelH