Skip to content

Instantly share code, notes, and snippets.

@tajchert
Created March 24, 2015 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tajchert/5a45deef2de9d667eb81 to your computer and use it in GitHub Desktop.
Save tajchert/5a45deef2de9d667eb81 to your computer and use it in GitHub Desktop.
Bundle bundle = statusBarNotification.getNotification().extras;
for (String key : bundle.keySet()) {
Object value = bundle.get(key);
if("android.wearable.EXTENSIONS".equals(key)){
Bundle wearBundle = ((Bundle) value);
for (String keyInner : wearBundle.keySet()) {
Object valueInner = wearBundle.get(keyInner);
if(keyInner != null && valueInner != null){
if("actions".equals(keyInner) && valueInner instanceof ArrayList){
ArrayList<Notification.Action> actions = new ArrayList<>();
actions.addAll((ArrayList) valueInner);
for(Notification.Action act : actions) {
if (act.getRemoteInputs() != null) {//API > 20 needed
android.app.RemoteInput[] remoteInputs = act.getRemoteInputs();
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment