你好,游客 登录 注册 搜索
背景:
阅读新闻

Android中链接到百度进行搜索 -

[日期:2013-04-20] 来源:  作者: [字体: ]
String st = et.getText().toString();
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 it = new Intent(Intent.ACTION_VIEW, uri); 
Timer timer = new Timer();  
TimerTask task = new TimerTask() {  
       @Override  
       public void run() {  
        startActivity(it); 
        }  
      };  
      timer.schedule(task, 0);

 

 

 

 






收藏 推荐 打印 | 录入:admin | 阅读:
相关新闻