0
맵의 가까운 곳에 표시 할지도 응용 프로그램을 만들었습니다. 사용자가지도의 핀을 클릭하면 경로를 표시하라는 경고 대화 상자가 나타납니다. 내 문제 핀이 빠르게 연속해서 여러 번 클릭 될 때 메시지 상자가 두 번 이상 나타납니다. 메시지가 한 번 이상 나타나기를 원하지 않습니다. 누구든지 나를 도울 수 있습니까? 내 코드는 다음과 같습니다 핀오버레이 항목의 빠른 연속 탭 처리
protected boolean onTap(int pos) {
final ProgressDialog myDialog = ProgressDialog.show(LocationBasedServicesV1.this, "", "Please Wait...");
OverlayItem item = items.get(pos);
Thread backgroundThread = new Thread(new Runnable(){
@Override
public void run() {
runOnUiThread(new Runnable() {
@Override
public void run() {
AlertDialog.Builder dialog = new AlertDialog.Builder( LocationBasedServicesV1.this);
dialog.setTitle(listDetailsVO.getName());
dialog.setMessage("Address: "+destination+"\nPhone: "+finalPhone+"\nEmail Id: "+finalEmail+"\nDistance: "+finalDistance+unit);
dialog.setPositiveButton("Show Route", new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface arg0, int arg1) {
try {
Intent i = new Intent(LocationBasedServicesV1.this, ShowRouteActivity.class);
i.putExtra("destination", destination);
i.putExtra("source", currentAddress);
startActivity(i);
} catch (Exception e) {
e.printStackTrace();
}
}
});
dialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
dialog.show();
}
});
myDialog.dismiss();
}
});
backgroundThread.start();
}
이 아이디어는 효과가 있습니다 ... 감사합니다. – Nishant