How to save data if a push is received from pushwoosh
<p>Hi I want to display a popup for a push notification and save message data into local db. I have integrated the Pushwoosh jar. My code is </p>

<pre><code>onCreate : if(!prefrences.getString("push", "").equalsIgnoreCase(""))
                {
                    Log.w("already registered", "already registered");
                    Log.e("Token", prefrences.getString("push", ""));
                }
            else
                { 
                //*** Registers For Push Woosh Notifications*//*
                    PushGCMIntentService p=new PushGCMIntentService();
                    PushManager push=new PushManager(this, APP_ID, SENDER_ID);
                    push.onStartup(this);
                    checkMessage(getIntent());
                }
@Override
protected void onNewIntent(Intent intent)
    {
        super.onNewIntent(intent);
        Log.e("ON NEW INTENT", "called");
        setIntent(intent);
        checkMessage(intent);
        setIntent(new Intent());
    }
private void checkMessage(Intent intent) 
    {

        if (null != intent)
            {
                if (intent.hasExtra(PushManager.PUSH_RECEIVE_EVENT))
                    {

                        Log.e("push message is " ,  intent.getExtras().getString(PushManager.PUSH_RECEIVE_EVENT));

                    }
                else if (intent.hasExtra(PushManager.REGISTER_EVENT))
                    {
                        Log.e("register",""+PushManager.REGISTER_EVENT);

                        //Toast.makeText(getApplicationContext(), ""+intent.getExtras().getString(PushManager.REGISTER_EVENT), Toast.LENGTH_SHORT).show();
                         s=intent.getExtras().getString(PushManager.REGISTER_EVENT);
                        Log.e("push message" ,  intent.getExtras().getString(PushManager.REGISTER_EVENT));
                        SharedPreferences pref =getSharedPreferences("Push",MODE_PRIVATE);
                        Editor edit=pref.edit();
                        edit.putString("push", s);
                        edit.commit();
                        Log.e("push token - - - &gt;" , pref.getString("push", "Novalue"));


                    }
                else if (intent.hasExtra(PushManager.UNREGISTER_EVENT))
                    {
                        Log.e("unregister","-------");

                    }
                else if (intent.hasExtra(PushManager.REGISTER_ERROR_EVENT))
                    {
                        Log.e("register error","----------");
                    }
                else if (intent.hasExtra(PushManager.UNREGISTER_ERROR_EVENT))
                    {
                        Log.e("unregister error","-----------");
                        //  Toast.makeText(getApplicationContext(), "DFGDHDSHshsh", Toast.LENGTH_LONG).show();
                    }
                resetIntentValues();
            }


    private void resetIntentValues()
{
    Intent mainAppIntent = getIntent();

    if (mainAppIntent.hasExtra(PushManager.PUSH_RECEIVE_EVENT))
    {
        mainAppIntent.putExtra(PushManager.PUSH_RECEIVE_EVENT, (String) null);
    }
    else if (mainAppIntent.hasExtra(PushManager.REGISTER_EVENT))
    {
        mainAppIntent.putExtra(PushManager.REGISTER_EVENT, (String) null);
    }
    else if (mainAppIntent.hasExtra(PushManager.UNREGISTER_EVENT))
    {
        mainAppIntent.putExtra(PushManager.UNREGISTER_EVENT, (String) null);
    }
    else if (mainAppIntent.hasExtra(PushManager.REGISTER_ERROR_EVENT))
    {
        mainAppIntent.putExtra(PushManager.REGISTER_ERROR_EVENT, (String) null);
    }
    else if (mainAppIntent.hasExtra(PushManager.UNREGISTER_ERROR_EVENT))
    {
        mainAppIntent.putExtra(PushManager.UNREGISTER_ERROR_EVENT, (String) null);
    }

    setIntent(mainAppIntent);
}
</code></pre>

<p>Asa I receive a message then "(intent.hasExtra(PushManager.PUSH_RECEIVE_EVENT))" must be triggered so I can pop up the message but it does not happen till i click the notification in notification bar. Also if a message contains a url then it is not triggered even though i click on the notification in notification bar. My manifest file is as :</p>

<pre><code>    &lt;activity android:name=".SplashScreen"
            android:launchMode="singleTop"
            android:noHistory="true"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|adjustResize" &gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;
&lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="My_APP_PACAKGE_NAME.MESSAGE" /&gt;
&lt;category android:name="android.intent.category.DEFAULT" /&gt;
            &lt;/intent-filter&gt;&lt;/activity&gt;
&lt;activity android:name="com.arellomobile.android.push.PushWebview" /&gt;
&lt;activity android:name="com.arellomobile.android.push.MessageActivity" /&gt;
&lt;activity android:name="com.arellomobile.android.push.PushHandlerActivity" /&gt;
&lt;receiver android:name="com.google.android.gcm.GCMBroadcastReceiver"
          android:permission="com.google.android.c2dm.permission.SEND" &gt;
            &lt;intent-filter&gt;
                &lt;action android:name="com.google.android.c2dm.intent.RECEIVE" /&gt;
&lt;action android:name="com.google.android.c2dm.intent.REGISTRATION" /&gt;
&lt;category android:name=" My_APP_PACAKGE_NAME " /&gt;
            &lt;/intent-filter&gt;
        &lt;/receiver&gt;
&lt;service android:name="com.arellomobile.android.push.PushGCMIntentService" /&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
    &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
    &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
    &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
    &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
&lt;permission
        android:name=" My_APP_PACAKGE_NAME.permission.C2D_MESSAGE"
        android:protectionLevel="signature" /&gt;
&lt;uses-permission android:name=" My_APP_PACAKGE_NAME.permission.C2D_MESSAGE" /&gt;
&lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /&gt;
</code></pre>

<p>Please help. Thanx in advance.</p>
