From 425b8d2dba6fa9f07575028ce7673503fa41324f Mon Sep 17 00:00:00 2001 From: Steve Slaven Date: Tue, 11 Jan 2011 13:21:40 -0800 Subject: Null exception fix 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; + } } } -- cgit v0.10.2