私はテキストボックスを持っていて、ここにテキストを入力すると、このテキストボックスをどのように処理してユーザーがテキストを入力するかを知りたいのですが、Google検索ページを開き、 apisを使いたい、ブラウザでGoogleのウェブサイトを開き、テキストを検索するだけです。ここでGoogle検索ページを開く
おかげ
私はテキストボックスを持っていて、ここにテキストを入力すると、このテキストボックスをどのように処理してユーザーがテキストを入力するかを知りたいのですが、Google検索ページを開き、 apisを使いたい、ブラウザでGoogleのウェブサイトを開き、テキストを検索するだけです。ここでGoogle検索ページを開く
おかげ
は、ソリューションです:
Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
String term = "TechnoTalkative"; // term which you want to search for
intent.putExtra(SearchManager.QUERY, term);
activity.startActivity(intent);
Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
String term =tb.getText.toString();<-- get from your textbox(tb)
intent.putExtra(SearchManager.QUERY, term);
activity.startActivity(intent);
あなたが直接ナビゲーターを開きたい場合は、あなたがそれを行うことができます。
String search = "what is android or something";
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.google.com/#hl=eng&output=search&q="+ search));
startActivity(browserIntent);