4.0 버전 이하의 장치에서 완벽하게 실행되는 응용 프로그램을 만들었거나 ICS를 말할 수는 있지만 위의 코드는 제대로 작동하지 않습니다. 내 응용 프로그램에서는 두 개의 버튼으로 동시에 멀티 터치를 만들려고했는데 버전 4.0 이하에서 완벽하게 작동했습니다. action_mask의 값은 터치 및 오프 터치시 6 번째 5입니다. 4.0 이상 버전에서는 1, 2, 0입니다. 이 이유는 무엇입니까? 대신android - 다른 장치에 다른 Action_mask 값이있는 이유
if(actionResolved == 5);
의
enter code here
@override
public boolean ontouch(Event ev , MotionEvent event)
{
int actionResolved = event.getAction() & MotionEvent.ACTION_MASK;
int action = paramMotionEvent.getAction() & MotionEvent.ACTION_POINTER_INDEX_MASK;
// int actionShift = paramMotionEvent.getAction() & MotionEvent.ACTION_POINTER_INDEX_SHIFT;
Log.i("fil", "action resolved" +actionResolved);
if(i==MotionEvent.ACTION_DOWN)
{
Log.i("fil", "action down");
Log.i("fil", "action down value" +MotionEvent.ACTION_DOWN);
}
if(actionResolved == 5);
{
Log.i("fil", "action resolved" +actionResolved);
scannerview1.startAnimation(anim1);
scannerView2.startAnimation(anim1);
}
if(actionResolved ==6)
{
scannerView2.clearAnimation();
scannerview1.clearAnimation();
}
return true;
}
그냥 대신 열거 형 상수를 사용하고 당신이 그것에 대해 걱정할 필요가 없습니다 내 코드입니다. 예 : MotionEvent.ACTION_POINTER_2_DOWN – Simon
실제로 특정 작업을 수행하기 위해 action_mask 값을 사용하고 있습니다. 왜냐하면 action_pointer_down이 설명서에서 말하는 것처럼 작동하지 않기 때문입니다. 다른 터치 이벤트에서 다른 작업을 수행하는 다른 방법이 있습니까? –
그런 다음 코드를 게시하고 문서에 따라 올바르게 작동하지 않는 방법을 정확하게 설명하십시오. 나는 게임을 추측하는 것을 즐긴다. – Simon