我的意图不是打开并显示FatalException
错误。我正在请求浏览器打开链接,但是它无法正常工作,并且找不到error
。
public void searchQuestion(View view) {
String queryString = search_input.getText().toString();
Log.d(TAG, "searchQuestion: "+ search_input.getText());
Uri buildURI = Uri.parse(BASE_URL).buildUpon()
.appendQueryParameter(QUERY_PARM, queryString)
.build();
Log.d("buildURI", "getBookInfo: " + buildURI);
Uri uri = Uri.parse(String.valueOf(buildURI));
Intent intent = new Intent(Intent.ACTION_WEB_SEARCH, uri);
startActivity(intent);
}
答案 0 :(得分:1)
使用ACTION_VIEW
代替ACTION_WEB_SEARCH
。
Uri uri = Uri.parse(String.valueOf(buildURI));
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
有关更多信息,https://developer.android.com/reference/android/content/Intent#ACTION_WEB_SEARCH