IntentBuilder icon indicating copy to clipboard operation
IntentBuilder copied to clipboard

Add check != null to intent

Open Kolyall opened this issue 7 years ago • 3 comments

Add check != null to intent , because if MainActivity is running in first time => Nullpointer exception

 public static void inject(Intent intent, MainActivity activity) {
    if (intent == null) return; // <---- add this line
    Bundle extras = intent.getExtras();
    if (extras.containsKey("mAppreciateSubmitted")) {
      activity.mAppreciateSubmitted = (Boolean) extras.get("mAppreciateSubmitted");
    } else {
      activity.mAppreciateSubmitted = null;
    }
  }

Kolyall avatar Nov 28 '16 14:11 Kolyall

Bundle extras = intent.getExtras();  
if(extras == null) return;  // <---- add this line
// other code

ssyijiu avatar Dec 02 '16 05:12 ssyijiu

@emilsjolander can we get this fixed? kind of an annoying issue

amnsinghl avatar Mar 23 '17 03:03 amnsinghl

@amnsinghl seems the lib is no more supported, so now I suggest to use this one compile 'com.github.marcinmoskala.activitystarter:activitystarter:0.30' apt 'com.github.marcinmoskala.activitystarter:activitystarter-compiler:0.30'

Kolyall avatar Mar 23 '17 11:03 Kolyall