0
こんにちは、アンドロイドアプリを作っていて、ジオロケーション/ Googleマップを使用しています。タブホスト以外は地図/アプリにはボタンがありません。ユーザーが1500ミリ秒間タップすると、ダイアログが起動するので、私は、私は同じ問題を抱えていたAndroid Motionevent overlay
class Touchy extends Overlay{
public boolean ontouchevent(MotionEvent e, MapView m){
if (e.getAction() == MotionEvent.ACTION_DOWN){
start = e.getEventTime();
}
if (e.getAction() == MotionEvent.ACTION_UP){
stop = e.getEventTime();
}
if (stop - start > 1500){
AlertDialog alert = new AlertDialog.Builder(SPtouch2fixActivity.this).create();
alert.setTitle("Alert");
alert.setMessage("This is an alert");
alert.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
alert.setButton2("Update Geolocation", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
alert.setButton3("cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
alert.show();
return true;
}
return false;
}
}
}
これは解決策ではありませんが、原因を明らかにするのに役立ちます。onTouchEventはontoucheventとは異なります。 –