From 92bea9162959c4b5af21bcd8299233bfe9078508 Mon Sep 17 00:00:00 2001 From: Steve Slaven Date: Mon, 3 Jan 2011 08:43:24 -0800 Subject: On first run show the home service like normal, allowing the popup to run and the view to assemble correctly diff --git a/src/net/hoopajoo/android/SoftKeys/Globals.java b/src/net/hoopajoo/android/SoftKeys/Globals.java index 3bc25a2..de6c76b 100644 --- a/src/net/hoopajoo/android/SoftKeys/Globals.java +++ b/src/net/hoopajoo/android/SoftKeys/Globals.java @@ -34,6 +34,7 @@ public class Globals extends Application { public boolean restartKeys = false; public int homeCounter = 0; public boolean didInitNotifications = false; + public boolean firstRun = true; public CommandShell getCommandShell() throws Exception { if( cmd == null ) { diff --git a/src/net/hoopajoo/android/SoftKeys/Keys.java b/src/net/hoopajoo/android/SoftKeys/Keys.java index 3a158f4..1bf0edd 100644 --- a/src/net/hoopajoo/android/SoftKeys/Keys.java +++ b/src/net/hoopajoo/android/SoftKeys/Keys.java @@ -195,7 +195,7 @@ public class Keys extends Activity implements OnClickListener, OnLongClickListen Toast.makeText( this, "Failed to find file: " + name + ", SoftKeys may not function", Toast.LENGTH_LONG ).show(); } }catch( Exception e ) { - Toast.makeText( this, "Failed to check for file: " + name, Toast.LENGTH_LONG ).show(); + Toast.makeText( this, "Unable to check for file: " + name, Toast.LENGTH_LONG ).show(); } } @@ -406,6 +406,14 @@ public class Keys extends Activity implements OnClickListener, OnLongClickListen public void onNewIntent( Intent i ) { Globals app = (Globals)getApplication(); + // if first run and intent is home then don't run normal home stuff + if( app.firstRun ) { + if( i.hasCategory( Intent.CATEGORY_HOME ) ) { + app.firstRun = false; + return; + } + } + ///////// TODO: remove null junk // handle real actions @@ -461,29 +469,7 @@ public class Keys extends Activity implements OnClickListener, OnLongClickListen this.finish(); } } - } - - - /* - // old home counter stuff - //d( "homecounter: " + app.homeCounter ); - if( app.homeCounter != 0 ) { - // they whacked home again - - // if 2clicker waiting then do 2clicker action - if( app.homeCounter > 1 ) { - SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences( this ); - clear_delayed_home(); - home_key_action( settings.getString( "homebuttonmulti", "launcher" ) ); - }else{ - // queue up an exit, if this timer doesn't finish before we come up again we'll run double-click instead - SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences( this ); - post_delayed_home( settings.getString( "homebutton", "exit" ) ); - } - } - */ - - + } } // calling this will run the desired home action in the specified time unless canceled by @@ -686,4 +672,4 @@ public class Keys extends Activity implements OnClickListener, OnLongClickListen startActivity( new Intent( this, Keys.class ) ); } -} \ No newline at end of file +} -- cgit v0.10.2