Sempre que tento executar a opção de item de menu para visitar o site cadastrado do aluno, apresenta o respectivo erro:
09-27 01:29:01.528 10179-10179/br.com.alura.agenda E/MenuItemImpl: Can't find activity to handle intent; ignoring android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=http://www.google.com }
Alguém poderia me ajudar, por gentileza?
@Override
public void onCreateContextMenu(ContextMenu menu, View v, final ContextMenu.ContextMenuInfo menuInfo) {
AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
final Aluno aluno = (Aluno) listaAlunos.getItemAtPosition(info.position);
MenuItem itemSite = menu.add("Visitar Site");
Intent intentSite = new Intent(Intent.ACTION_VIEW);
String site = aluno.getSite();
if (site.startsWith("http://")){
site = "http://"+site;
}
intentSite.setData(Uri.parse(site));
itemSite.setIntent(intentSite);
MenuItem deletar = menu.add("Deletar");
deletar.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem menuItem) {
AlunoDAO alunoDAO = new AlunoDAO(ListaAlunosActivity.this);
alunoDAO.deleta(aluno);
alunoDAO.close();
carregaLista();
return false;
}
});
}