Example usage for android.os Bundle getCharSequence

List of usage examples for android.os Bundle getCharSequence

Introduction

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

Prototype

@Override
@Nullable
public CharSequence getCharSequence(@Nullable String key) 

Source Link

Document

Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.

Usage

From source file:com.klinker.android.twitter.activities.compose.NotificationCompose.java

public CharSequence getVoiceReply(Intent intent) {
    Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
    if (remoteInput != null) {
        return remoteInput.getCharSequence("extra_voice_reply");
    }/*from   w ww.  j  a va 2s  . c o m*/
    return null;
}

From source file:com.negaheno.android.WearReplyReceiver.java

@Override
public void onReceive(Context context, Intent intent) {
    Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
    if (remoteInput == null) {
        return;/*from   w w w.  j  av a  2 s .c  o  m*/
    }
    CharSequence text = remoteInput.getCharSequence(NotificationsController.EXTRA_VOICE_REPLY);
    if (text == null || text.length() == 0) {
        return;
    }
    long dialog_id = intent.getLongExtra("dialog_id", 0);
    int max_id = intent.getIntExtra("max_id", 0);
    if (dialog_id == 0 || max_id == 0) {
        return;
    }
    SendMessagesHelper.getInstance().sendMessage(text.toString(), dialog_id);
    MessagesController.getInstance().markDialogAsRead(dialog_id, max_id, max_id, 0, 0, true, false);
}

From source file:org.hermes.android.WearReplyReceiver.java

@Override
public void onReceive(Context context, Intent intent) {
    Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
    if (remoteInput == null) {
        return;//from   w  w  w .  j  a v a 2 s  .c  om
    }
    CharSequence text = remoteInput.getCharSequence(NotificationsController.EXTRA_VOICE_REPLY);
    if (text == null || text.length() == 0) {
        return;
    }
    long dialog_id = intent.getLongExtra("dialog_id", 0);
    int max_id = intent.getIntExtra("max_id", 0);
    if (dialog_id == 0 || max_id == 0) {
        return;
    }
    SendMessagesHelper.getInstance().sendMessage(text.toString(), dialog_id, null, null, true);
    MessagesController.getInstance().markDialogAsRead(dialog_id, max_id, max_id, 0, 0, true, false);
}

From source file:org.telegram.messenger.AutoMessageReplyReceiver.java

@Override
public void onReceive(Context context, Intent intent) {
    Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
    if (remoteInput == null) {
        return;/* www  .j a  v  a  2 s  .c o  m*/
    }
    CharSequence text = remoteInput.getCharSequence(NotificationsController.EXTRA_VOICE_REPLY);
    if (text == null || text.length() == 0) {
        return;
    }
    long dialog_id = intent.getLongExtra("dialog_id", 0);
    int max_id = intent.getIntExtra("max_id", 0);
    if (dialog_id == 0 || max_id == 0) {
        return;
    }
    SendMessagesHelper.getInstance().sendMessage(text.toString(), dialog_id, null, null, true, false);
    MessagesController.getInstance().markDialogAsRead(dialog_id, max_id, max_id, 0, 0, true, false);
}

From source file:com.panahit.telegramma.AutoMessageReplyReceiver.java

@Override
public void onReceive(Context context, Intent intent) {
    Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
    if (remoteInput == null) {
        return;// w ww. j a va2 s  .c  o  m
    }
    CharSequence text = remoteInput.getCharSequence(NotificationsController.EXTRA_VOICE_REPLY);
    if (text == null || text.length() == 0) {
        return;
    }
    long dialog_id = intent.getLongExtra("dialog_id", 0);
    int max_id = intent.getIntExtra("max_id", 0);
    if (dialog_id == 0 || max_id == 0) {
        return;
    }
    SendMessagesHelper.getInstance().sendMessage(text.toString(), dialog_id, null, null, true, false, null,
            null);
    MessagesController.getInstance().markDialogAsRead(dialog_id, max_id, max_id, 0, true, false);
}

From source file:com.ferdi2005.secondgram.AutoMessageReplyReceiver.java

@Override
public void onReceive(Context context, Intent intent) {
    ApplicationLoader.postInitApplication();
    Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
    if (remoteInput == null) {
        return;/*from  ww  w  . j a v  a 2  s  .  c om*/
    }
    CharSequence text = remoteInput.getCharSequence(NotificationsController.EXTRA_VOICE_REPLY);
    if (text == null || text.length() == 0) {
        return;
    }
    long dialog_id = intent.getLongExtra("dialog_id", 0);
    int max_id = intent.getIntExtra("max_id", 0);
    if (dialog_id == 0 || max_id == 0) {
        return;
    }
    SendMessagesHelper.getInstance().sendMessage(text.toString(), dialog_id, null, null, true, null, null,
            null);
    MessagesController.getInstance().markDialogAsRead(dialog_id, max_id, max_id, 0, true, false);
}

From source file:edu.mit.mobile.android.livingpostcards.DeleteDialogFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    final Bundle args = getArguments();
    mMessage = args.getCharSequence(ARG_MESSAGE);
    mTitle = args.getCharSequence(ARG_TITLE);
    final Uri item = args.getParcelable(ARG_ITEM_URI);
    mItem = item;//from  ww w .ja va2 s.  c om

    final String type = getActivity().getContentResolver().getType(mItem);
    if (type == null || !type.startsWith(ProviderUtils.TYPE_ITEM_PREFIX)) {
        Toast.makeText(getActivity().getApplicationContext(), "Cannot handle the requested content type",
                Toast.LENGTH_LONG).show();
        dismiss();
        return;
    }
}

From source file:org.cafemember.messenger.AutoMessageReplyReceiver.java

@Override
public void onReceive(Context context, Intent intent) {
    ApplicationLoader.postInitApplication();
    Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
    if (remoteInput == null) {
        return;//from   w  ww  .j  a va2  s  .c o  m
    }
    CharSequence text = remoteInput.getCharSequence(NotificationsController.EXTRA_VOICE_REPLY);
    if (text == null || text.length() == 0) {
        return;
    }
    long dialog_id = intent.getLongExtra("dialog_id", 0);
    int max_id = intent.getIntExtra("max_id", 0);
    if (dialog_id == 0 || max_id == 0) {
        return;
    }
    SendMessagesHelper.getInstance().sendMessage(text.toString(), dialog_id, null, null, true, false, null,
            null, null);
    MessagesController.getInstance().markDialogAsRead(dialog_id, max_id, max_id, 0, true, false);
}

From source file:com.commonsware.android.messaging.RemoteInputReceiver.java

@Override
public void onReceive(Context ctxt, Intent i) {
    Bundle input = RemoteInput.getResultsFromIntent(i);

    if (input != null) {
        CharSequence text = input.getCharSequence(EXTRA_INPUT);

        if (text != null) {
            MESSAGES.push(new Message(text));
        } else {//from   w w w  .j a v  a2  s .c  om
            Log.e(getClass().getSimpleName(), "No voice response speech");
        }
    } else {
        Log.e(getClass().getSimpleName(), "No voice response Bundle");
    }

    NotificationManagerCompat.from(ctxt).notify(RemoteInputReceiver.NOTIFY_ID, buildNotification(ctxt).build());
}

From source file:com.bdevlin.apps.ui.fragments.HelpListFragment.java

private void initializeArgCache() {
    if (mTitle != null)
        return;/*from w  ww  . j a  v a2 s . co  m*/
    Bundle args = getArguments();
    mTitle = args.getString(TITLE);
    mMessage = args.getCharSequence(MESSAGE);
    mContent = args.getCharSequence(CONTENT);
}