Olá, estou começando em programar com android e não estou conseguindo abrir o browser nativo.
O código é este:
public class AbrirBrowser extends Activity implements OnClickListener {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.form_browser);
final Button b=(Button)findViewById(R.id.botaoOk);
b.setOnClickListener(this);
}
public void onClick(View arg0) {
EditText Endereco=(EditText)findViewById(R.id.Endereco);
String endereco=Endereco.getText().toString();
Uri uri =Uri.parse(endereco);
startActivity(new Intent(Intent.ACTION_VIEW,uri));
}
}
quando chega em: startActivity(new Intent(Intent.ACTION_VIEW,uri)); a aplicação fecha dando um erro:
FATAL EXCEPTION : main
06-07 18:17:22.181: ERROR/AndroidRuntime(621): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=www.google.com.br }
Se alaguém poder me ajudar, agradeço.