I'm doing an application similar to a calendar and I need to put a button to open a registered site, I already did a long click on the table and it worked, but on a button I can not use the same syntax
@Override
public void onCreateContextMenu(final 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 ="http://www.uol.com.br";
aluno.getSite();
if(!site.startsWith("http://")) {
site = "http://" + site;
}
intentSite.setData(Uri.parse(site));
itemSite.setIntent(intentSite);