Project

General

Profile

« Previous | Next » 

Revision b96a20a4

Added by Leszek Koltunski over 4 years ago

Catch an error that sometimes happens in the field.

View differences:

src/main/java/org/distorted/main/RubikSurfaceView.java
27 27
import android.util.DisplayMetrics;
28 28
import android.view.MotionEvent;
29 29

  
30
import com.google.firebase.crashlytics.FirebaseCrashlytics;
31

  
30 32
import org.distorted.library.type.Static2D;
31 33
import org.distorted.library.type.Static3D;
32 34
import org.distorted.library.type.Static4D;
......
358 360
      if( mPtrID1!=INVALID_POINTER_ID && mPtrID2!=INVALID_POINTER_ID)
359 361
        {
360 362
        int pointer = event.findPointerIndex(mPtrID2);
363
        float pX,pY;
361 364

  
362
        float pX = event.getX(pointer);
363
        float pY = event.getY(pointer);
365
        try
366
          {
367
          pX = event.getX(pointer);
368
          pY = event.getY(pointer);
369
          }
370
        catch(IllegalArgumentException ex)
371
          {
372
          mPtrID1=INVALID_POINTER_ID;
373
          mPtrID2=INVALID_POINTER_ID;
374

  
375
          FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
376
          crashlytics.setCustomKey("DragError", "pointer="+pointer );
377
          crashlytics.recordException(ex);
378

  
379
          return;
380
          }
364 381

  
365 382
        float x2 = (pX - mScreenWidth*0.5f)/mScreenMin;
366 383
        float y2 = (mScreenHeight*0.5f -pY)/mScreenMin;

Also available in: Unified diff