I have the following code that starts an activity after detecting an onTap event.
Trouble is that more often than not it detects 2-3 taps from one user just pressing and so starts multiple. Is there any way to dampen the effect and only open the once?
protected boolean onTap(int i) {
Log.i("TAP","CALLED");
myOverlayItem item =getItem(i);
if (selectedName.equals(item.getTitle())){
try{
Intent myIntent = new Intent(AppMain.this, DetailActivity.class);
myIntent.putExtra( "int", i);
myIntent.putExtra( "string", selectedName );
AppMain.this.startActivity(myIntent);
}catch (Exception e){
Log.e("Error", "Cannot launch", e);
}
}
}
Thanks!
Try setting a boolean to true so you can make sure the code only runs once