Example usage for android.os Bundle toString

List of usage examples for android.os Bundle toString

Introduction

In this page you can find the example usage for android.os Bundle toString.

Prototype

@Override
    public synchronized String toString() 

Source Link

Usage

From source file:com.shopify.sample.activity.CheckoutActivity.java

public void startPaytmPayment() {

    PaytmPGService Service = PaytmPGService.getStagingService();
    Map<String, String> paramMap = new HashMap<String, String>();
    final Checkout checkout1 = getSampleApplication().getCheckout();

    DecimalFormat decimalFormat = new DecimalFormat(".");
    decimalFormat.setGroupingUsed(false);
    decimalFormat.setDecimalSeparatorAlwaysShown(false);
    String amount = checkout1.getPaymentDue();
    // these are mandatory parameters

    paramMap.put("ORDER_ID", checkout1.getToken());
    paramMap.put("MID", "Variet41832464800424");
    paramMap.put("CUST_ID", checkout1.getCustomerId().toString());
    paramMap.put("CHANNEL_ID", "WAP");
    paramMap.put("INDUSTRY_TYPE_ID", "Retail");
    paramMap.put("WEBSITE", "APP_URL");
    paramMap.put("TXN_AMOUNT", amount);
    paramMap.put("THEME", "merchant");
    paramMap.put("EMAIL", "ankit81008@gmail.com");
    paramMap.put("MOBILE_NO", "9886000725");
    PaytmOrder Order = new PaytmOrder(paramMap);

    PaytmMerchant Merchant = new PaytmMerchant("http://www.3deestudio.com/myshop/paytm/generateChecksum.php",
            "http://www.3deestudio.com/myshop/paytm/verifyChecksum.php");

    Service.initialize(Order, Merchant, null);

    Service.startPaymentTransaction(this, true, true, new PaytmPaymentTransactionCallback() {
        @Override/*  ww w.j a v  a 2 s. co  m*/
        public void someUIErrorOccurred(String inErrorMessage) {
            // Some UI Error Occurred in Payment Gateway Activity.
            // // This may be due to initialization of views in
            // Payment Gateway Activity or may be due to //
            // initialization of webview. // Error Message details
            // the error occurred.
        }

        @Override
        public void onTransactionSuccess(Bundle inResponse) {
            // After successful transaction this method gets called.
            // // Response bundle contains the merchant response
            // parameters.
            Log.d("LOG", "Payment Transaction is successful " + inResponse.toString());
            findViewById(R.id.discount_row).setVisibility(View.VISIBLE);
            ((TextView) findViewById(R.id.razorpayPaymentID)).setText(inResponse.toString());
            ((TextView) findViewById(R.id.razorpayPaymentStatus)).setText("Success");
            Toast.makeText(getApplicationContext(), "Payment Transaction is successful ", Toast.LENGTH_LONG)
                    .show();
        }

        @Override
        public void onTransactionFailure(String inErrorMessage, Bundle inResponse) {
            // This method gets called if transaction failed. //
            // Here in this case transaction is completed, but with
            // a failure. // Error Message describes the reason for
            // failure. // Response bundle contains the merchant
            // response parameters.
            Log.d("LOG", "Payment Transaction Failed " + inErrorMessage);
            findViewById(R.id.discount_row).setVisibility(View.VISIBLE);
            ((TextView) findViewById(R.id.razorpayPaymentID)).setText(inErrorMessage);
            ((TextView) findViewById(R.id.razorpayPaymentStatus)).setText("failure");
            Toast.makeText(getBaseContext(), "Payment Transaction Failed ", Toast.LENGTH_LONG).show();
        }

        @Override
        public void networkNotAvailable() { // If network is not
            // available, then this
            // method gets called.
            Toast.makeText(getBaseContext(), "networkNotAvailable ", Toast.LENGTH_LONG).show();
        }

        @Override
        public void clientAuthenticationFailed(String inErrorMessage) {
            // This method gets called if client authentication
            // failed. // Failure may be due to following reasons //
            // 1. Server error or downtime. // 2. Server unable to
            // generate checksum or checksum response is not in
            // proper format. // 3. Server failed to authenticate
            // that client. That is value of payt_STATUS is 2. //
            // Error Message describes the reason for failure.
            Toast.makeText(getBaseContext(), "clientAuthenticationFailed ", Toast.LENGTH_LONG).show();
        }

        @Override
        public void onErrorLoadingWebPage(int iniErrorCode, String inErrorMessage, String inFailingUrl) {
            Toast.makeText(getBaseContext(), "onErrorLoadingWebPage ", Toast.LENGTH_LONG).show();
        }

        // had to be added: NOTE
        @Override
        public void onBackPressedCancelTransaction() {
            // TODO Auto-generated method stub
            Toast.makeText(getBaseContext(), "onBackPressedCancelTransaction ", Toast.LENGTH_LONG).show();
        }

    });

}

From source file:com.kratav.tinySurprise.notification.MyGcmListenerService.java

/**
 * Called when message is received./* w ww  .  j a  v  a2 s . c  o  m*/
 *
 * @param from SenderID of the sender.
 * @param data Data bundle containing message data as key/value pairs.
 *             For Set of keys use data.keySet().
 */
// [START receive_message]
@Override
public void onMessageReceived(String from, Bundle data) {
    //[{subtitle=hello, smallIcon=NA, sound=1, title=Hiii, vibrate=1, largeIcon=NA, message=Hello Ashutosh, collapse_key=type2}]
    title = data.getString("title");
    subtitle = data.getString("subtitle");
    bigMsg = data.getString("message");
    smallIcon = data.getString("smallIcon");
    largeIcon = data.getString("largeIcon");
    collapse_key = data.getString("collapse_key");
    //Log.d(TAG, "bundle data: " + data.toString());
    Log.d(TAG, "data: " + data.toString());

    if (from.startsWith("/topics/")) {
        // message received from some topic.
    } else {
        // normal downstream message.
    }

    Intent dialogShowIntent = new Intent(QuickstartPreferences.SHOW_ALERT_DIALOG);
    dialogShowIntent.putExtra("message", data.toString());
    LocalBroadcastManager.getInstance(this).sendBroadcast(dialogShowIntent);
    prepareNotification();
    // [END_EXCLUDE]

    if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        if (collapse_key.equals("type1")) { //Image Type
            notification = notificationType1();
        } else if (collapse_key.equals("type2")) { // TextType
            notification = notificationType2();
        }
    } else {
        notification = preAPI16();
    }

    if (notification != null) {
        NotificationManager notificationManager = (NotificationManager) getSystemService(
                Context.NOTIFICATION_SERVICE);

        notificationManager.notify(0 /* ID of notification */, notification);
    }
}

From source file:com.example.igorklimov.tictactoe.wifi.GcmIntentService.java

@Override
protected void onHandleIntent(Intent intent) {
    Bundle extras = intent.getExtras();
    GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this);
    // The getMessageType() intent parameter must be the intent you received
    // in your BroadcastReceiver.
    String messageType = gcm.getMessageType(intent);

    if (extras != null && !extras.isEmpty()) { // has effect of unparcelling Bundle
        // Since we're not using two way messaging, this is all we really to check for
        if (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType)) {
            Logger.getLogger("GCM_RECEIVED").log(Level.INFO, extras.toString());

            String action = extras.getString(ACTION);
            String message = "";

            if (action == null) {
                return;
            }//from w ww .  ja  v  a2s  . c o m

            if (action.equals(INVITE_TO_PLAY)) {
                message = getApplicationContext().getString(R.string.format_invite_to_play, extras.get(NAME));
            } else if (action.equals(NEW_USER)) {
                message = getApplicationContext().getString(R.string.new_user, extras.get(NAME));
            } else if (action.equals(START_GAME)) {
                message = getApplicationContext().getString(R.string.start_game);
            }
            showToast(message);
            //                sendNotification(message);
        }
    }
    GcmBroadcastReceiver.completeWakefulIntent(intent);
}

From source file:com.hoangsong.zumechat.gcm.MyGcmListenerService.java

/**
 * Called when message is received.//ww  w.ja va 2  s.com
 *
 * @param from SenderID of the sender.
 * @param data Data bundle containing message data as key/value pairs.
 *             For Set of keys use data.keySet().
 */
// [START receive_message]
@Override
public void onMessageReceived(String from, Bundle data) {

    // [START_EXCLUDE]
    /**
     * Production applications would usually process the message here.
     * Eg: - Syncing with server.
     *     - Store message in local database.
     *     - Update UI.
     */

    try {
        String message = data.getString("message");
        String sound = data.getString("sound");
        String vibrate = data.getString("vibrate");
        if (Constants.DEBUG_MODE) {
            Log.d(TAG, "data: " + data.toString());
            Log.d(TAG, "From: " + from);
            Log.d(TAG, "Message: " + message);
            Log.d(TAG, "sound: " + sound);
            Log.d(TAG, "vibrate: " + vibrate);
        }
        CustomNotification notification = new CustomNotification();
        notification.setMessage(message);
        notification.setSound(sound);
        notification.setVibrate(vibrate);
        sendNotification(notification);

    } catch (CancellationException e) {
        if (Constants.DEBUG_MODE) {
            Log.e(Constants.TAG,
                    MyGcmListenerService.class.getName() + " CancellationException: " + e.toString());
        }
    } /*catch (InterruptedException e) {
      if(Constants.DEBUG_MODE){
          Log.e(Constants.TAG, MyGcmListenerService.class.getName() + " InterruptedException: " + e.toString());
      }
      } catch (ExecutionException e) {
      if(Constants.DEBUG_MODE){
          Log.e(Constants.TAG, MyGcmListenerService.class.getName() + " ExecutionException: " + e.toString());
      }
      } */catch (Exception e) {
        if (Constants.DEBUG_MODE) {
            Log.e(Constants.TAG, MyGcmListenerService.class.getName() + " Exception: " + e.toString());
        }
    }

    /**
     * In some cases it may be useful to show a notification indicating to the user
     * that a message was received.
     */
    //sendNotification(message);
    // [END_EXCLUDE]
}

From source file:org.sonardrone.gcm.GcmIntentService.java

@Override
protected void onHandleIntent(Intent intent) {
    Bundle extras = intent.getExtras();
    GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this);
    // The getMessageType() intent parameter must be the intent you received
    // in your BroadcastReceiver.
    String messageType = gcm.getMessageType(intent);

    if (!extras.isEmpty()) { // has effect of unparcelling Bundle
        /*/*from  w  w w  . j  av  a  2s  . c o m*/
         * Filter messages based on message type. Since it is likely that GCM will be
         * extended in the future with new message types, just ignore any message types you're
         * not interested in, or that you don't recognize.
         */
        String msg = extras.toString();
        if (GoogleCloudMessaging.MESSAGE_TYPE_SEND_ERROR.equals(messageType)) {
            Log.i(TAG, "Send error: " + msg);
        } else if (GoogleCloudMessaging.MESSAGE_TYPE_DELETED.equals(messageType)) {
            Log.i(TAG, "Deleted messages on server: " + msg);
            // If it's a regular GCM message, do some work.
        } else if (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType)) {
            Intent forwardIntent = new Intent("GCM_COMMAND");
            // add data
            forwardIntent.putExtra("message", msg);
            LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
            Log.i(TAG, "Received: " + msg);
        }
    }
    // Release the wake lock provided by the WakefulBroadcastReceiver.
    GcmBroadcastReceiver.completeWakefulIntent(intent);
}

From source file:com.dbztech.universalpresenterremote.upr.GcmIntentService.java

@Override
protected void onHandleIntent(Intent intent) {
    Bundle extras = intent.getExtras();
    GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this);
    // The getMessageType() intent parameter must be the intent you received
    // in your BroadcastReceiver.
    String messageType = gcm.getMessageType(intent);

    if (!extras.isEmpty()) { // has effect of unparcelling Bundle
        /*/*w  w  w.ja  v  a 2s.co m*/
         * Filter messages based on message type. Since it is likely that GCM will be
         * extended in the future with new message types, just ignore any message types you're
         * not interested in, or that you don't recognize.
         */
        Log.i(TAG, "Received: " + extras.toString());

        String message = extras.getString("message");
        if (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType) && message.equals("UPR-Refresh")) {
            // Post notification of received message.
            ServerCommunication.checkStatusSync();
            sendNotification("");
        }
    }
    // Release the wake lock provided by the WakefulBroadcastReceiver.
    GcmBroadcastReceiver.completeWakefulIntent(intent);
}

From source file:com.hybris.mobile.lib.commerce.provider.CatalogProvider.java

/**
 * Request a sync (we force it)//from www. j a  v a 2  s .c o  m
 *
 * @param bundle extras parameters for the sync
 */
private void requestSync(Bundle bundle) {

    if (bundle == null) {
        bundle = new Bundle();
    }

    Log.i(TAG, "Requesting a sync with bundle: " + bundle.toString());

    // Parameters to force the sync without any delay
    bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
    bundle.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
    ContentResolver.requestSync(account, authority, bundle);
}

From source file:com.linute.linute.API.MyGcmListenerService.java

/**
 * Called when message is received./*from   w ww.  ja  v a 2 s .c  o  m*/
 *
 * @param from SenderID of the sender.
 * @param data Data bundle containing message data as key/value pairs.
 *             For Set of keys use data.keySet().
 */
// [START receive_message]
@Override
public void onMessageReceived(String from, Bundle data) {
    //String message = data.getString("message");

    //doesn't post notifications if user is logged out
    SharedPreferences pref = getSharedPreferences(LinuteConstants.SHARED_PREF_NAME, MODE_PRIVATE);
    if (pref.getString("userID", null) == null) {
        return;
    }

    String action = data.getString("action");
    Log.d("AAA", data.toString());
    if ("notification global".equals(action)) {
        String notifId = data.getString("nid");
        new LSDKAnalytics(this).postRecievedNotification(notifId, new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {
                Log.e(TAG, "failed to post global notification received");
            }

            @Override
            public void onResponse(Call call, Response response) throws IOException {

            }
        });
    }
    //        Log.d(TAG, "From: " + from);
    //        Log.d(TAG, "Message: " + message);
    //        for (String key : data.keySet()) {
    //            Log.d(TAG, key + " is a key in the bundle");
    //        }
    //        if (from.startsWith("/topics/")) {
    //            // message received from some topic.
    //        } else {
    //            // normal downstream message.
    //        }

    // [START_EXCLUDE]
    /**
     * Production applications would usually process the message here.
     * Eg: - Syncing with server.
     *     - Store message in local database.
     *     - Update UI.
     */

    /**
     * In some cases it may be useful to show a notification indicating to the user
     * that a message was received.
     */

    sendNotification(data, action);
    // [END_EXCLUDE]
}

From source file:com.procasy.dubarah_nocker.gcm.MyGcmPushReceiver.java

/**
 * Called when message is received.// w  w  w. ja va  2 s . c om
 *
 * @param from   SenderID of the sender.
 * @param bundle Data bundle containing message data as key/value pairs.
 *               For Set of keys use data.keySet().
 */

@Override
public void onMessageReceived(String from, Bundle bundle) {

    MainActivity.getInstance().updateNotification();

    try {

        Log.e("notify_gcm", "success , type = " + bundle.toString());

        switch (bundle.getString(GCM_TAG)) {
        case "GENERAL": {
            NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
                    .setSmallIcon(R.drawable.hourly_logo).setContentTitle(bundle.getString(TITLE_TAG))
                    .setContentText(bundle.getString(DESC_TAG));
            Intent resultIntent = new Intent(this, MainActivity.class);
            TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
            stackBuilder.addParentStack(MainActivity.class);
            stackBuilder.addNextIntent(resultIntent);
            PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0,
                    PendingIntent.FLAG_UPDATE_CURRENT);
            mBuilder.setContentIntent(resultPendingIntent);
            mBuilder.setDefaults(
                    Notification.DEFAULT_SOUND | Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE);
            NotificationManager mNotificationManager = (NotificationManager) getSystemService(
                    Context.NOTIFICATION_SERVICE);
            mNotificationManager.notify(12, mBuilder.build());
            mNotification = new com.procasy.dubarah_nocker.Helper.Notification(getApplicationContext());
            mNotification.open();
            try {
                ContentValues contentValues = new ContentValues();
                contentValues.put(mNotification.COL_notification_type, GENERAL_TAG);
                contentValues.put(mNotification.COL_notfication_status, 0);
                contentValues.put(mNotification.COL_notfication_title, bundle.getString(TITLE_TAG));
                contentValues.put(mNotification.COL_notfication_desc, bundle.getString(DESC_TAG));
                contentValues.put(mNotification.COL_notfication_content, bundle.getString(CONTENT_TAG));
                mNotification.insertEntry(contentValues);
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                mNotification.close();
            }
            break;
        }

        case "HELP": {
            NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
                    .setSmallIcon(R.drawable.hourly_logo).setContentTitle(bundle.getString(TITLE_TAG))
                    .setContentText(bundle.getString(DESC_TAG));
            Intent resultIntent = new Intent(this, MainActivity.class);
            TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
            stackBuilder.addParentStack(MainActivity.class);
            stackBuilder.addNextIntent(resultIntent);
            PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0,
                    PendingIntent.FLAG_UPDATE_CURRENT);
            mBuilder.setContentIntent(resultPendingIntent);
            mBuilder.setDefaults(
                    Notification.DEFAULT_SOUND | Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE);
            NotificationManager mNotificationManager = (NotificationManager) getSystemService(
                    Context.NOTIFICATION_SERVICE);
            mNotificationManager.notify(12, mBuilder.build());
            mNotification = new com.procasy.dubarah_nocker.Helper.Notification(getApplicationContext());
            mNotification.open();
            try {
                ContentValues contentValues = new ContentValues();
                contentValues.put(mNotification.COL_notification_type, HELP_TAG);
                contentValues.put(mNotification.COL_notfication_status, 0);
                contentValues.put(mNotification.COL_notfication_title, bundle.getString(TITLE_TAG));
                contentValues.put(mNotification.COL_notfication_desc, bundle.getString(DESC_TAG));
                contentValues.put(mNotification.COL_notfication_content, bundle.getString(CONTENT_TAG));
                mNotification.insertEntry(contentValues);
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                mNotification.close();
            }
            JSONObject content = new JSONObject(bundle.getString("content"));
            JSONObject hr = content.getJSONObject("hr");
            JSONArray album = content.getJSONArray("album");
            System.out.println(content.getInt("hr_id"));
            System.out.println(content.toString());
            Bundle bundle1 = new Bundle();
            bundle1.putString("hr_id", hr.getString("hr_id"));
            bundle1.putString("hr_user_id", hr.getString("hr_user_id"));
            bundle1.putString("hr_description", hr.getString("hr_description"));
            bundle1.putString("hr_est_date", hr.getString("hr_est_date"));
            bundle1.putString("hr_est_time", hr.getString("hr_est_time"));
            bundle1.putString("hr_skill_id", hr.getString("hr_skill_id"));
            bundle1.putString("hr_ua_id", hr.getString("hr_ua_id"));
            bundle1.putString("hr_voice_record", hr.getString("hr_voice_record"));
            bundle1.putString("hr_language", hr.getString("hr_language"));
            bundle1.putString("hr_lat", hr.getString("hr_lat"));
            bundle1.putString("hr_lon", hr.getString("hr_lon"));
            bundle1.putString("hr_address", hr.getString("hr_address"));
            ArrayList<String> array = new ArrayList<>();
            for (int i = 0; i < album.length(); i++) {
                JSONObject object = album.getJSONObject(i);
                array.add(object.getString("ahr_img"));
            }
            bundle1.putStringArrayList("album", array);

            Intent intent = (new Intent(getApplicationContext(), JobRequestActivity.class));
            intent.putExtras(bundle1);
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            getApplicationContext().startActivity(intent);

            break;
        }

        case "APPOINTEMENT": {
            NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
                    .setSmallIcon(R.drawable.hourly_logo).setContentTitle(bundle.getString(TITLE_TAG))
                    .setContentText(bundle.getString(DESC_TAG));
            Intent resultIntent = new Intent(this, MainActivity.class);
            TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
            stackBuilder.addParentStack(MainActivity.class);
            stackBuilder.addNextIntent(resultIntent);
            PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0,
                    PendingIntent.FLAG_UPDATE_CURRENT);
            mBuilder.setContentIntent(resultPendingIntent);
            mBuilder.setDefaults(
                    Notification.DEFAULT_SOUND | Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE);
            NotificationManager mNotificationManager = (NotificationManager) getSystemService(
                    Context.NOTIFICATION_SERVICE);
            mNotificationManager.notify(12, mBuilder.build());
            mNotification = new com.procasy.dubarah_nocker.Helper.Notification(getApplicationContext());
            mNotification.open();
            try {
                ContentValues contentValues = new ContentValues();
                contentValues.put(mNotification.COL_notification_type, APPOINTEMENT_TAG);
                contentValues.put(mNotification.COL_notfication_status, 0);
                contentValues.put(mNotification.COL_notfication_title, bundle.getString(TITLE_TAG));
                contentValues.put(mNotification.COL_notfication_desc, bundle.getString(DESC_TAG));
                contentValues.put(mNotification.COL_notfication_content, bundle.getString(CONTENT_TAG));
                mNotification.insertEntry(contentValues);
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                mNotification.close();
            }
            break;
        }

        case "QOUTA_USER": {
            NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
                    .setSmallIcon(R.drawable.hourly_logo).setContentTitle(bundle.getString(TITLE_TAG))
                    .setContentText(bundle.getString(DESC_TAG));
            Intent resultIntent = new Intent(this, MainActivity.class);
            TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
            stackBuilder.addParentStack(MainActivity.class);
            stackBuilder.addNextIntent(resultIntent);
            PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0,
                    PendingIntent.FLAG_UPDATE_CURRENT);
            mBuilder.setContentIntent(resultPendingIntent);
            mBuilder.setDefaults(
                    Notification.DEFAULT_SOUND | Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE);
            NotificationManager mNotificationManager = (NotificationManager) getSystemService(
                    Context.NOTIFICATION_SERVICE);
            mNotificationManager.notify(12, mBuilder.build());
            mNotification = new com.procasy.dubarah_nocker.Helper.Notification(getApplicationContext());
            mNotification.open();
            try {
                ContentValues contentValues = new ContentValues();
                contentValues.put(mNotification.COL_notification_type, USER_Qouta_TAG);
                contentValues.put(mNotification.COL_notfication_status, 0);
                contentValues.put(mNotification.COL_notfication_title, bundle.getString(TITLE_TAG));
                contentValues.put(mNotification.COL_notfication_desc, bundle.getString(DESC_TAG));
                contentValues.put(mNotification.COL_notfication_content, bundle.getString(CONTENT_TAG));
                mNotification.insertEntry(contentValues);
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                mNotification.close();
            }
            break;
        }

        case "QOUTA_NOCKER": {
            NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
                    .setSmallIcon(R.drawable.hourly_logo).setContentTitle(bundle.getString(TITLE_TAG))
                    .setContentText(bundle.getString(DESC_TAG));
            Intent resultIntent = new Intent(this, MainActivity.class);
            TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
            stackBuilder.addParentStack(MainActivity.class);
            stackBuilder.addNextIntent(resultIntent);
            PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0,
                    PendingIntent.FLAG_UPDATE_CURRENT);
            mBuilder.setContentIntent(resultPendingIntent);
            mBuilder.setDefaults(
                    Notification.DEFAULT_SOUND | Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE);
            NotificationManager mNotificationManager = (NotificationManager) getSystemService(
                    Context.NOTIFICATION_SERVICE);
            mNotificationManager.notify(12, mBuilder.build());
            mNotification = new com.procasy.dubarah_nocker.Helper.Notification(getApplicationContext());
            mNotification.open();
            try {
                ContentValues contentValues = new ContentValues();
                contentValues.put(mNotification.COL_notification_type, Nocker_Qouta_TAG);
                contentValues.put(mNotification.COL_notfication_status, 0);
                contentValues.put(mNotification.COL_notfication_title, bundle.getString(TITLE_TAG));
                contentValues.put(mNotification.COL_notfication_desc, bundle.getString(DESC_TAG));
                contentValues.put(mNotification.COL_notfication_content, bundle.getString(CONTENT_TAG));
                mNotification.insertEntry(contentValues);
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                mNotification.close();
            }
            break;
        }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

}

From source file:com.downrighttech.dmxdip.MainActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    outState.putString("span", editText_Span.getText().toString());
    outState.putString("start", editText_Start.getText().toString());
    super.onSaveInstanceState(outState);
    Log.v("lifeCycle", "onSaveInstanceState-" + outState.toString());
}