package com.chopping.application;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;

import com.chopping.bus.ExternalAppChangedEvent;

import de.greenrobot.event.EventBus;

/**
 * Event that will be sent after an external App has been installed.
 *
 * @author Xinyue Zhao
 */
public final class InstalledAppReceiver extends BroadcastReceiver {
	@Override
	public void onReceive(Context context, Intent intent) {
		//Info UI to refresh button status.
		Uri data = intent.getData();
		String packageName = data.getSchemeSpecificPart();
		EventBus.getDefault().post(new ExternalAppChangedEvent(packageName));
	}
}

@@ -554,16 +554,38 @@
 Data();%0A
+%09%09if(data != null) %7B%0A%09
 %09%09String
@@ -629,16 +629,17 @@
 Part();%0A
+%09
 %09%09EventB
@@ -702,13 +702,17 @@
 Name));%0A
+%09%09%7D%0A
 %09%7D%0A%7D%0A

Fix null-crash in InstalledAppReceiver