2010-02-10 24 views

Trả lời

16

Bạn có thể bắt đầu một 'xem' hoạt động, mà sẽ được trình duyệt cung cấp một URL:

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

    } 

} 
+0

Cảm ơn bạn rất nhiều nó đang làm việc – deepthi

Các vấn đề liên quan