title: Trying to extract notification text to Activity (parse)
body: <p>I'm using <a href="https://parse.com/" rel="nofollow">Parse</a> for push notifications in my app and I want to show the notification text in Activity when it is clicked. Here's how I'm trying to do it.</p>
  
  <p>I created a new activity which is supposed to handle incoming notifications named PushNotification.class and I created this custom class inside it:</p>
  
  <pre><code>public class PushNotification extends BroadcastReceiver {
  private static final String TAG = "MyCustomReceiver";
  
  @Override
  public void onReceive(Context context, Intent intent) {
  try {
        String action = intent.getAction();
        String channel = intent.getExtras().getString("com.parse.Channel");
        JSONObject json = new JSONObject(intent.getExtras().getString("com.parse.Data"));
  
        Log.d(TAG, "got action " + action + " on channel " + channel + " with:");
        Iterator itr = json.keys();
        while (itr.hasNext()) {
          String key = (String) itr.next();
          Log.d(TAG, "..." + key + " =&gt; " + json.getString(key));
        }
        String message = json.getString("alert");
      } catch (JSONException e) {
        Log.d(TAG, "JSONException: " + e.getMessage());
      }
      }
  }
  </code></pre>
  
  <p>Now the main problem is that this line of code no longer works:</p>
  
  <pre><code>PushService.setDefaultPushCallback(this, PushNotification.class);
  </code></pre>
  
  <p>It underlines the "setDefaultPushCallback" part because appearantly it doesn't recognize PushNotification.class as Activity anymore.</p>
  
  <p>I already tried asking this on parse.com but I didn't get much help there and I need to solve this as soon as possible.</p>