mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
fix NPE: jniThread gets turned to null sometimes, so test
This commit is contained in:
parent
2dd56d08af
commit
d3ce4aa4c7
1 changed files with 42 additions and 40 deletions
|
@ -81,6 +81,8 @@ public class BoardView extends View implements BoardHandler, SyncedDraw {
|
||||||
@Override
|
@Override
|
||||||
public boolean onTouchEvent( MotionEvent event )
|
public boolean onTouchEvent( MotionEvent event )
|
||||||
{
|
{
|
||||||
|
boolean wantMore = null != m_jniThread;
|
||||||
|
if ( wantMore ) {
|
||||||
int action = event.getAction();
|
int action = event.getAction();
|
||||||
int xx = (int)event.getX();
|
int xx = (int)event.getX();
|
||||||
int yy = (int)event.getY();
|
int yy = (int)event.getY();
|
||||||
|
@ -124,8 +126,8 @@ public class BoardView extends View implements BoardHandler, SyncedDraw {
|
||||||
DbgUtils.logf( "onTouchEvent: unknown action: %d", action );
|
DbgUtils.logf( "onTouchEvent: unknown action: %d", action );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true; // required to get subsequent events
|
return wantMore; // true required to get subsequent events
|
||||||
}
|
}
|
||||||
|
|
||||||
// private void printMode( String comment, int mode )
|
// private void printMode( String comment, int mode )
|
||||||
|
|
Loading…
Add table
Reference in a new issue