final AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle("test");
alert.setMessage("test");
// Set an EditText view to get user input
final EditText input = new EditText(this);
alert.setView(input);
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
// Do something with value!
String link = input.getText().toString();
startActivity(new Intent(Intent.ACTION_VIEW).setData(Uri
.parse(link)));
}
});
alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
// Canceled.
}
});
what I want is the browser to open on what the user inputted in the edittext before clicking Ok ..
currently the app force closes
found the mistake and fixed it, nvm. THANKS. u need http in the first 😀
The mistake was that you need
http://at the beginning to open a browser usingAction_View