From 74ed68aef10a0c28dc1e1837991120b2c744ffee Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Mon, 4 Jun 2012 12:14:22 -0400 Subject: [PATCH] Fixed action related null pointer closes #100 Signed-off-by: Ricky Barrette --- .../LocationRinger/ui/ListActivity.java | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/LocationRinger/src/com/TwentyCodes/android/LocationRinger/ui/ListActivity.java b/LocationRinger/src/com/TwentyCodes/android/LocationRinger/ui/ListActivity.java index 700f983..34aba07 100644 --- a/LocationRinger/src/com/TwentyCodes/android/LocationRinger/ui/ListActivity.java +++ b/LocationRinger/src/com/TwentyCodes/android/LocationRinger/ui/ListActivity.java @@ -106,16 +106,18 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli break; } - if(ListActivity.this.getIntent().getAction().equals(ACTION_NEW_RINGER)) - finish(); - else - ListActivity.this.mListView.post(new Runnable(){ - @Override - public void run(){ - progress.dismiss(); - populate(); - } - }); + final String action = ListActivity.this.getIntent().getAction(); + if(action != null) + if(action.equals(ACTION_NEW_RINGER)) + finish(); + else + ListActivity.this.mListView.post(new Runnable(){ + @Override + public void run(){ + progress.dismiss(); + populate(); + } + }); } }).start(); } @@ -185,8 +187,9 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli if(!this.getIntent().hasExtra(NO_SPLASH)) showSplashScreen(); - if(action.equals(ACTION_NEW_RINGER)) - startActivityForResult(new Intent(this, RingerInformationActivity.class), ACTIVITY_CREATE); + if(action != null) + if(action.equals(ACTION_NEW_RINGER)) + startActivityForResult(new Intent(this, RingerInformationActivity.class), ACTIVITY_CREATE); } /**