Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy will same GestureEvent code work on android 2.3.5 but not on 4.0.3
    primarykey
    data
    text
    <p>This code will work on a phone with 2.3.5 but not on a tablet with 4.0.3:</p> <pre><code>@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_NO_TITLE); this.setContentView(R.layout.rotate_image); mRotator = (ImageView) findViewById(R.id.rotateImage_image_rotator); mGDetector = new GestureDetector(getApplicationContext(), this); findViewById(R.id.rotateImage_background).setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return mGDetector.onTouchEvent(event); } }); } @Override public boolean onDown(MotionEvent e) { // TODO Auto-generated method stub return true; } @Override public boolean onFling(MotionEvent start, MotionEvent finish, float velocityX, float velocityY) { return false; } @Override public void onLongPress(MotionEvent e) { // TODO Auto-generated method stub } @Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { if(e2.getHistorySize() == 0){ } else{ if(e2.getX() &gt; e2.getHistoricalX(e2.getHistorySize() -1)){ updateRotation(true); } else{ updateRotation(false); } } return true; } @Override public void onShowPress(MotionEvent e) { // TODO Auto-generated method stub } @Override public boolean onSingleTapUp(MotionEvent e) { // TODO Auto-generated method stub return false; } </code></pre> <p>Is there some kind of bug that tablets have or something? I mean, its the same code, it works perfectly on the phone, but it wont register on the tablet. Is it becaose of the android version, or because it is a tablet?</p> <p>EDIT: To be more specific, for some reason, the function onScroll does not get called on a tablet or gets called only once, but works like a charm on a phone</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload