Java Code Examples for android.support.v4.app.RemoteInput#getResultsFromIntent()
The following examples show how to use
android.support.v4.app.RemoteInput#getResultsFromIntent() .
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: AutoMessageReplyReceiver.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
@Override public void onReceive(Context context, Intent intent) { ApplicationLoader.postInitApplication(); Bundle remoteInput = RemoteInput.getResultsFromIntent(intent); if (remoteInput == null) { return; } 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); int currentAccount = intent.getIntExtra("currentAccount", 0); if (dialog_id == 0 || max_id == 0) { return; } SendMessagesHelper.getInstance(currentAccount).sendMessage(text.toString(), dialog_id, null, null, true, null, null, null); MessagesController.getInstance(currentAccount).markDialogAsRead(dialog_id, max_id, max_id, 0, false, 0, true); }
Example 2
Source File: NotificationListenerService.java From wear-notify-for-reddit with Apache License 2.0 | 6 votes |
@Override public int onStartCommand(Intent intent, int flags, int startId) { if (null == intent || null == intent.getAction()) { return Service.START_STICKY; } String action = intent.getAction(); if (action.equals(ACTION_RESPONSE)) { Bundle remoteInputResults = RemoteInput.getResultsFromIntent(intent); CharSequence replyMessage = ""; if (remoteInputResults != null) { replyMessage = remoteInputResults.getCharSequence(EXTRA_VOICE_REPLY); } String subject = intent.getStringExtra(Constants.PATH_KEY_MESSAGE_SUBJECT); String toUser = intent.getStringExtra(Constants.PATH_KEY_MESSAGE_TO_USER); String fullname = intent.getStringExtra(Constants.PATH_KEY_POST_FULLNAME); boolean isDirectMessage = intent.getBooleanExtra(Constants.PATH_KEY_IS_DIRECT_MESSAGE, false); sendReplyToPhone(replyMessage.toString(), fullname, toUser, subject, isDirectMessage); } return Service.START_STICKY; }
Example 3
Source File: VoiceNotiActivity.java From wearable with Apache License 2.0 | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_voice_noti); //note android developer page, shows this in a separate method, but not necessary. Bundle remoteInput = RemoteInput.getResultsFromIntent( getIntent()); if (remoteInput != null) { info = remoteInput.getCharSequence(EXTRA_VOICE_REPLY).toString(); } else { info = "No voice reponse."; } logger = (TextView) findViewById(R.id.logger); logger.setText(info); }
Example 4
Source File: ResponderService.java From AndroidWearable-Samples with Apache License 2.0 | 6 votes |
@Override public int onStartCommand(Intent intent, int flags, int startId) { if (null == intent || null == intent.getAction()) { return Service.START_STICKY; } String action = intent.getAction(); if (action.equals(ACTION_RESPONSE)) { Bundle remoteInputResults = RemoteInput.getResultsFromIntent(intent); CharSequence replyMessage = ""; if (remoteInputResults != null) { replyMessage = remoteInputResults.getCharSequence(EXTRA_REPLY); } processIncoming(replyMessage.toString()); } else if (action.equals(MainActivity.ACTION_GET_CONVERSATION)) { broadcastMessage(mCompleteConversation.toString()); } return Service.START_STICKY; }
Example 5
Source File: NotificationIntentReceiver.java From AndroidWearable-Samples with Apache License 2.0 | 6 votes |
@Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(ACTION_EXAMPLE)) { if (mEnableMessages) { String message = intent.getStringExtra(NotificationUtil.EXTRA_MESSAGE); Bundle remoteInputResults = RemoteInput.getResultsFromIntent(intent); CharSequence replyMessage = null; if (remoteInputResults != null) { replyMessage = remoteInputResults.getCharSequence(NotificationUtil.EXTRA_REPLY); } if (replyMessage != null) { message = message + ": \"" + replyMessage + "\""; } Toast.makeText(context, message, Toast.LENGTH_SHORT).show(); } } else if (intent.getAction().equals(ACTION_ENABLE_MESSAGES)) { mEnableMessages = true; } else if (intent.getAction().equals(ACTION_DISABLE_MESSAGES)) { mEnableMessages = false; } }
Example 6
Source File: ResponderService.java From android-ElizaChat with Apache License 2.0 | 6 votes |
@Override public int onStartCommand(Intent intent, int flags, int startId) { if (null == intent || null == intent.getAction()) { return Service.START_STICKY; } String action = intent.getAction(); if (action.equals(ACTION_RESPONSE)) { Bundle remoteInputResults = RemoteInput.getResultsFromIntent(intent); CharSequence replyMessage = ""; if (remoteInputResults != null) { replyMessage = remoteInputResults.getCharSequence(EXTRA_REPLY); } processIncoming(replyMessage.toString()); } else if (action.equals(MainActivity.ACTION_GET_CONVERSATION)) { broadcastMessage(mCompleteConversation.toString()); } return Service.START_STICKY; }
Example 7
Source File: WearableReplayActivity.java From android-samples with Apache License 2.0 | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_wearable_replay); CharSequence replayString; //get the voice replays from the remote input. Bundle bundle = RemoteInput.getResultsFromIntent(getIntent()); if (bundle != null) { replayString = bundle.getCharSequence(WearableNotification.REMOTE_INPUT_LABEL); } else { replayString = "No replay from the response."; } Toast.makeText(this, replayString, Toast.LENGTH_LONG).show(); finish(); }
Example 8
Source File: AutoMessageReplyReceiver.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
@Override public void onReceive(Context context, Intent intent) { ApplicationLoader.postInitApplication(); Bundle remoteInput = RemoteInput.getResultsFromIntent(intent); if (remoteInput == null) { return; } 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); int currentAccount = intent.getIntExtra("currentAccount", 0); if (dialog_id == 0 || max_id == 0) { return; } SendMessagesHelper.getInstance(currentAccount).sendMessage(text.toString(), dialog_id, null, null, true, null, null, null); MessagesController.getInstance(currentAccount).markDialogAsRead(dialog_id, max_id, max_id, 0, false, 0, true); }
Example 9
Source File: WearReplyReceiver.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
@Override public void onReceive(Context context, Intent intent) { ApplicationLoader.postInitApplication(); Bundle remoteInput = RemoteInput.getResultsFromIntent(intent); if (remoteInput == null) { return; } 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); int currentAccount = intent.getIntExtra("currentAccount", 0); if (dialog_id == 0 || max_id == 0) { return; } SendMessagesHelper.getInstance(currentAccount).sendMessage(text.toString(), dialog_id, null, null, true, null, null, null); MessagesController.getInstance(currentAccount).markDialogAsRead(dialog_id, max_id, max_id, 0, false, 0, true); }
Example 10
Source File: WearReplyReceiver.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
@Override public void onReceive(Context context, Intent intent) { ApplicationLoader.postInitApplication(); Bundle remoteInput = RemoteInput.getResultsFromIntent(intent); if (remoteInput == null) { return; } 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); int currentAccount = intent.getIntExtra("currentAccount", 0); if (dialog_id == 0 || max_id == 0) { return; } SendMessagesHelper.getInstance(currentAccount).sendMessage(text.toString(), dialog_id, null, null, true, null, null, null); MessagesController.getInstance(currentAccount).markDialogAsRead(dialog_id, max_id, max_id, 0, false, 0, true); }
Example 11
Source File: ReplyService.java From GcmForMojo with GNU General Public License v3.0 | 5 votes |
@Override protected void onHandleIntent(Intent intent) { if (intent == null) { return; } currentUserList = MyApplication.getInstance().getCurrentUserList(); Bundle remoteInput = RemoteInput.getResultsFromIntent(intent); String message = null; if (remoteInput != null) { message = remoteInput.getCharSequence(KEY_TEXT_REPLY).toString(); } directReplyBundle = intent.getExtras(); notifyId = directReplyBundle.getInt("notifyId"); msgId = directReplyBundle.getString("msgId"); msgTitle =directReplyBundle.getString("msgTitle"); msgBody =directReplyBundle.getString("msgBody"); senderType =directReplyBundle.getString("senderType"); msgType =directReplyBundle.getString("msgType"); msgTime =directReplyBundle.getString("msgTime"); if(directReplyBundle.containsKey("qqPackgeName")) qqPackgeName =directReplyBundle.getString("qqPackgeName"); if(directReplyBundle.containsKey("wxPackgeName")) wxPackgeName =directReplyBundle.getString("wxPackgeName"); msgSave = MyApplication.getInstance().getMsgSave(); sendmsg(message,msgId,senderType,msgType); }
Example 12
Source File: NotificationActionTapReceiver.java From mobile-messaging-sdk-android with Apache License 2.0 | 5 votes |
private String getInputTextFromIntent(Intent intent, NotificationAction notificationAction) { if (notificationAction == null || !notificationAction.hasInput()) { return null; } Bundle input = RemoteInput.getResultsFromIntent(intent); if (input == null) { return null; } CharSequence sequence = input.getCharSequence(notificationAction.getId()); return sequence != null ? sequence.toString() : ""; }
Example 13
Source File: AndroidAutoReplyReceiver.java From Silence with GNU General Public License v3.0 | 5 votes |
private CharSequence getMessageText(Intent intent) { Bundle remoteInput = RemoteInput.getResultsFromIntent(intent); if (remoteInput != null) { return remoteInput.getCharSequence(VOICE_REPLY_KEY); } return null; }
Example 14
Source File: CarBroadcastReceiver.java From matrix-android-console with Apache License 2.0 | 5 votes |
/** * Get the message text from the intent. * Note that you should call * RemoteInput.getResultsFromIntent() to process * the RemoteInput. */ private CharSequence getMessageText(Intent intent) { Bundle remoteInput = RemoteInput.getResultsFromIntent(intent); if (remoteInput != null) { return remoteInput.getCharSequence(NotificationUtils.CAR_VOICE_REPLY_KEY); } return null; }
Example 15
Source File: MessageReplyReceiver.java From io2015-codelabs with Apache License 2.0 | 5 votes |
/** * Get the message text from the intent. * Note that you should call {@code RemoteInput#getResultsFromIntent(intent)} to process * the RemoteInput. */ private CharSequence getMessageText(Intent intent) { Bundle remoteInput = RemoteInput.getResultsFromIntent(intent); if (remoteInput != null) { return remoteInput.getCharSequence(MessagingService.EXTRA_VOICE_REPLY); } return null; }
Example 16
Source File: MessageReplyReceiver.java From io2015-codelabs with Apache License 2.0 | 5 votes |
/** * Get the message text from the intent. * Note that you should call {@code RemoteInput#getResultsFromIntent(intent)} to process * the RemoteInput. */ private CharSequence getMessageText(Intent intent) { Bundle remoteInput = RemoteInput.getResultsFromIntent(intent); if (remoteInput != null) { return remoteInput.getCharSequence(MessagingService.EXTRA_VOICE_REPLY); } return null; }
Example 17
Source File: MessageReplyReceiver.java From android-MessagingService with Apache License 2.0 | 5 votes |
/** * Get the message text from the intent. * Note that you should call {@code RemoteInput#getResultsFromIntent(intent)} to process * the RemoteInput. */ private CharSequence getMessageText(Intent intent) { Bundle remoteInput = RemoteInput.getResultsFromIntent(intent); if (remoteInput != null) { return remoteInput.getCharSequence( MessagingService.EXTRA_REMOTE_REPLY); } return null; }
Example 18
Source File: ReplyBroadcastReceiver.java From Wrox-ProfessionalAndroid-4E with Apache License 2.0 | 5 votes |
@Override public void onReceive(Context context, Intent intent) { Bundle remoteInput = RemoteInput.getResultsFromIntent(intent); CharSequence message = remoteInput != null ? remoteInput.getCharSequence(KEY_TEXT_REPLY) : null; // TODO Handle the reply sent from the notification. }
Example 19
Source File: AutoMessageReplyReceiver.java From AndroidDemoProjects with Apache License 2.0 | 5 votes |
private String getMessageFromIntent( Intent intent ) { //Note that Android Auto does not currently allow voice responses in their simulator Bundle remoteInput = RemoteInput.getResultsFromIntent( intent ); if( remoteInput != null && remoteInput.containsKey( "extra_voice_reply" ) ) { return remoteInput.getCharSequence( "extra_voice_reply" ).toString(); } return null; }
Example 20
Source File: MainActivity.java From Android-9-Development-Cookbook with MIT License | 5 votes |
private CharSequence getReplyText(Intent intent) { Bundle notificationReply = RemoteInput.getResultsFromIntent(intent); if (notificationReply != null) { return notificationReply.getCharSequence(KEY_REPLY_TEXT); } return null; }