diff options
author | Steve Slaven <bpk@hoopajoo.net> | 2011-01-11 21:21:40 (GMT) |
---|---|---|
committer | Steve Slaven <bpk@hoopajoo.net> | 2011-01-11 21:21:40 (GMT) |
commit | 425b8d2dba6fa9f07575028ce7673503fa41324f (patch) | |
tree | 6a5a969119799bfe8351c2a6da75a26171637ad2 /src/net | |
parent | 82efc5405e2628d9d7384cf694d460590dbbda09 (diff) | |
download | SoftKeys-425b8d2dba6fa9f07575028ce7673503fa41324f.zip SoftKeys-425b8d2dba6fa9f07575028ce7673503fa41324f.tar.gz SoftKeys-425b8d2dba6fa9f07575028ce7673503fa41324f.tar.bz2 |
Null exception fix
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/hoopajoo/android/SoftKeys/Keys.java | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/src/net/hoopajoo/android/SoftKeys/Keys.java b/src/net/hoopajoo/android/SoftKeys/Keys.java index b16c741..9a28721 100644 --- a/src/net/hoopajoo/android/SoftKeys/Keys.java +++ b/src/net/hoopajoo/android/SoftKeys/Keys.java @@ -435,32 +435,34 @@ public class Keys extends Activity implements OnClickListener, OnLongClickListen } // check for key actions from notifications - if( true ) { + if( i != null ) { String action = i.getAction(); - int keyid = 0; - if( action.equals( ACTION_HOME ) ) { - app.doHomeAction( false ); - this.finish(); - return; - } - - if( action.equals( ACTION_BACK ) ) { - keyid = K.KEYID_BACK; - } - - if( action.equals( ACTION_MENU ) ) { - keyid = K.KEYID_MENU; - } - - if( action.equals( ACTION_SEARCH ) ) { - keyid = K.KEYID_SEARCH; - } - - if( keyid != 0 ) { - //Log.d( "SoftKeys.SendInput", "resolved key: " + keyid ); - app.sendKeys( new int[] { keyid } ); - this.finish(); - return; + if( action != null ) { + int keyid = 0; + if( action.equals( ACTION_HOME ) ) { + app.doHomeAction( false ); + this.finish(); + return; + } + + if( action.equals( ACTION_BACK ) ) { + keyid = K.KEYID_BACK; + } + + if( action.equals( ACTION_MENU ) ) { + keyid = K.KEYID_MENU; + } + + if( action.equals( ACTION_SEARCH ) ) { + keyid = K.KEYID_SEARCH; + } + + if( keyid != 0 ) { + //Log.d( "SoftKeys.SendInput", "resolved key: " + keyid ); + app.sendKeys( new int[] { keyid } ); + this.finish(); + return; + } } } |