I have an activity like the following code and I want when I click on the button I see a list from the browsers and when I choose one of them I go to the https://www.google.com
website using the chosen browser. I know that I should use the intent method for this, But I do not know that how can I use this method in my manifest file and in my MainActivity.java
file.
public class MainActivity extends Activity {
Button button;
String url = "https://www.google.com";
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.activity);
button = (Button) findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
}}