developers.ndroid reports that RemoteInput.getResultsFromIntent (intent); this means that we do not need to parse ClipData, so I did some research and realized what exactly needed to be analyzed with this ClipData, and this is how I solved my problem:
private void getMessageText(Intent intent){ ClipData extra = intent.getClipData(); Log.d("TAG", "" + extra.getItemCount()); //Found that I only have 1 extra ClipData.Item item = extra.getItemAt(0); //Retreived that extra as a ClipData.Item //ClipData.Item can be one of the 3 below types, debugging revealed //The RemoteInput is of type Intent Log.d("TEXT", "" + item.getText()); Log.d("URI", "" + item.getUri()); Log.d("INTENT", "" + item.getIntent()); //I edited this step multiple times until I discovered that the //ClipData.Item intent contained extras, or rather 1 extra, which was another bundle //The key for that bundle was "android.remoteinput.resultsData" //and the key to get the voice input from wearable notification was EXTRA_VOICE_REPLY which //was set in my previous activity that generated the Notification. Bundle extras = item.getIntent().getExtras(); Bundle bundle = extras.getBundle("android.remoteinput.resultsData"); for (String key : bundle.keySet()) { Object value = bundle.get(key); Log.d("TAG", String.format("%s %s (%s)", key, value.toString(), value.getClass().getName())); } tvVoiceMessage.setText(bundle.get(EXTRA_VOICE_REPLY).toString()); }
This answer should be useful to anyone interested in developing a wearable application using notifications and voice replies before the release of Android-L.
source share