Java Code Examples for android.content.Intent#getBooleanArrayExtra()

The following examples show how to use android.content.Intent#getBooleanArrayExtra() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DeleteNotificationReceiver.java    From mollyim-android with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onReceive(final Context context, Intent intent) {
  if (DELETE_NOTIFICATION_ACTION.equals(intent.getAction())) {
    ApplicationDependencies.getMessageNotifier().clearReminder(context);

    final long[]    ids = intent.getLongArrayExtra(EXTRA_IDS);
    final boolean[] mms = intent.getBooleanArrayExtra(EXTRA_MMS);

    if (ids == null  || mms == null || ids.length != mms.length) return;

    new AsyncTask<Void, Void, Void>() {
      @Override
      protected Void doInBackground(Void... params) {
        for (int i=0;i<ids.length;i++) {
          if (!mms[i]) DatabaseFactory.getSmsDatabase(context).markAsNotified(ids[i]);
          else         DatabaseFactory.getMmsDatabase(context).markAsNotified(ids[i]);
        }

        return null;
      }
    }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
  }
}
 
Example 2
Source File: DeleteNotificationReceiver.java    From Silence with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onReceive(final Context context, Intent intent) {
  if (DELETE_NOTIFICATION_ACTION.equals(intent.getAction())) {
    MessageNotifier.clearReminder(context);

    final long[]    ids = intent.getLongArrayExtra(EXTRA_IDS);
    final boolean[] mms = intent.getBooleanArrayExtra(EXTRA_MMS);

    if (ids == null  || mms == null || ids.length != mms.length) return;

    new AsyncTask<Void, Void, Void>() {
      @Override
      protected Void doInBackground(Void... params) {
        for (int i=0;i<ids.length;i++) {
          if (!mms[i]) DatabaseFactory.getSmsDatabase(context).markAsNotified(ids[i]);
          else         DatabaseFactory.getMmsDatabase(context).markAsNotified(ids[i]);
        }

        return null;
      }
    }.execute();
  }
}
 
Example 3
Source File: IntentUtil.java    From Ticket-Analysis with MIT License 4 votes vote down vote up
public static boolean[] getBooleanArrayExtra(Intent intent, String name) {
    if (!hasIntent(intent) || !hasExtra(intent, name)) return null;
    return intent.getBooleanArrayExtra(name);
}