when I click an item in maps, it will appears positive button that reads "Route to". Question, how do I start activity from that positive button?
I also use like this,
dialog.setPositiveButton("Tampilkan Rute", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int Button) {
Intent i = new Intent(this, Rute.class);
startActivity(i);
}
});
to startactivity into Rute class but it always say "remove argument to match intent()" then I don't know what to do.
here is my code
@Override
protected boolean onTap(int index) {
OverlayItem item = items.get(0);
AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);
dialog.setTitle(item.getTitle());
dialog.setMessage(item.getSnippet());
dialog.setPositiveButton("Tampilkan Rute", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int Button) {
Intent i = new Intent(this, Rute.class);
startActivity(i);
}
});
dialog.setNegativeButton("Kembali", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int Button) {
dialog.cancel();
}
});
dialog.show();
return true;
}
Any suggestions will be greatly appreciated. Thank's
i'm sorry if my english is bad :(