Android中链接到百度进行搜索
生活随笔
收集整理的這篇文章主要介紹了
Android中链接到百度进行搜索
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
String st = editText.getText().toString().trim();
Uri uri = null;
try {
uri = Uri.parse("http://www.baidu.com/s?&ie=utf-8&oe=UTF-8&wd=" + URLEncoder.encode(st, "UTF-8"));
} catch (UnsupportedEncodingException e1) {
e1.printStackTrace();
}
final Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(uri);
Timer timer = new Timer();
TimerTask task = new TimerTask() {
@Override
public void run() {
startActivity(intent);
}
};
timer.schedule(task, 0);
?
?
?
?
轉載于:https://www.cnblogs.com/duelsol/archive/2013/03/08/2950806.html
總結
以上是生活随笔為你收集整理的Android中链接到百度进行搜索的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Doc命令收集(一)
- 下一篇: 重写JFrame的扩大 缩小 关闭按钮