7
我想重定向到特定的URL,而在按键如何重定向到特定的URL,同时点击android中的按钮?
我想重定向到特定的URL,而在按键如何重定向到特定的URL,同时点击android中的按钮?
点击可以启动“视图”的活动,这将是浏览器获得一个网址:
public class HelloWorld extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Assuming you are using xml layout
Button button = (Button)findViewById(R.id.Button01);
button.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
Intent viewIntent =
new Intent("android.intent.action.VIEW",
Uri.parse("http://www.stackoverflow.com/"));
startActivity(viewIntent);
}
});
}
}
非常感谢你的工作 – deepthi 2010-02-10 11:59:10
你是什么实际问题?你已经尝试了一些,然后失败了吗?这个Anroid有什么关系? – 2010-02-10 11:52:20