私はアンドロイドアプリケーションを作成しています。ここに imageview があります。私の目標は、画像上で指を動かしたときにデータベースから次の画像を取得することです
float nPicturePositionM = 0;
public boolean onTouch(View v, MotionEvent event) {
boolean aHandledL = false;
if (event.getAction() == MotionEvent.ACTION_MOVE) {
float nNewPicturePosL = event.getX();
if (nPicturePositionM < nNewPicturePosL) {
nPicturePositionM = nNewPicturePosL;
GetPictures(true);
} else {
nPicturePositionM = nNewPicturePosL;
GetPictures(false);
}
aHandledL = true;
}
return aHandledL;
//return false;
}
タッチイベントを使用してどのように処理できますか? ギャラリーで行うように、画像をスライドさせる必要があります