title: Parse.com runtime crash - android
body: <p>i am getting a lot of reports from users about my app crashing. The constant error appears to be associated with my parse.com initialisation, however, i have set it up as outlined in the parse tutorial. </p>
  
  <p>here is the Stack Trace:</p>
  
  <pre><code>java.lang.RuntimeException: Unable to start receiver com.parse.ParseBroadcastReceiver: java.lang.RuntimeException: applicationContext is null. You must call Parse.initialize(context, applicationId, clientKey) before using the Parse library.
  at android.app.ActivityThread.handleReceiver(ActivityThread.java:2580)
  at android.app.ActivityThread.access$1700(ActivityThread.java:151)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
  at android.os.Handler.dispatchMessage(Handler.java:110)
  at android.os.Looper.loop(Looper.java:193)
  at android.app.ActivityThread.main(ActivityThread.java:5292)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:515)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
  at dalvik.system.NativeStart.main(Native Method)
  Caused by: java.lang.RuntimeException: applicationContext is null. You must call Parse.initialize(context, applicationId, clientKey) before using the Parse library.
  at com.parse.Parse.checkContext(Parse.java:606)
  at com.parse.Parse.getApplicationContext(Parse.java:214)
  at com.parse.ManifestInfo.getContext(ManifestInfo.java:322)
  at com.parse.ManifestInfo.getPackageManager(ManifestInfo.java:330)
  at com.parse.ManifestInfo.getPackageInfo(ManifestInfo.java:356)
  at com.parse.ManifestInfo.deviceSupportsGcm(ManifestInfo.java:441)
  at com.parse.ManifestInfo.getPushType(ManifestInfo.java:210)
  at com.parse.PushService.startServiceIfRequired(PushService.java:168)
  at com.parse.ParseBroadcastReceiver.onReceive(ParseBroadcastReceiver.java:19)
  at android.app.ActivityThread.handleReceiver(ActivityThread.java:2573)
  ... 10 more
  </code></pre>
  
  <p>and here is my initialisation code:</p>
  
  <pre><code>@Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_home_screen);
          Parse.initialize(this, "hGG5RdgNVdI7eCeZynV32lWYXywQRHkpp5zLdY7Q", "TwmNbpBYEt4u3euE3lzNIgwyroSl8RPGF2dJFsPv");
  
          ParseInstallation.getCurrentInstallation().saveInBackground();
  </code></pre>
  
  <p>Can anybody see what is causing this error, and how to fix it?</p>
  
  <p>below is my receiver code:</p>
  
  <pre><code>public static class Receiver extends ParsePushBroadcastReceiver {
          private String notificationText;
          private Boolean notificationreceived = false;
          public Receiver(){
          }
          private static final String TAG = "MyNotificationsReceiver";
  
          @Override
          public void onPushOpen(Context context, Intent intent) {
              Log.e("Push", "Clicked");
              Intent i = new Intent(context, HomeScreen.class);
              notificationreceived = true;
              i.putExtra("alert",notificationText);
              i.putExtra("alertreceived", notificationreceived);
              i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
              context.startActivity(i);
              Scb998.scb988b=true;
  
                  try {
                      JSONObject json = new JSONObject(intent.getExtras().getString("com.parse.Data"));
  
                      Scb998.msg = json.getString("alert");
  
  
                  } catch (JSONException e) {
                      Log.d(TAG, "JSONException: " + e.getMessage());
  
              }
          }
  
      }
  </code></pre>