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);