Created
March 24, 2015 15:58
-
-
Save tajchert/5a45deef2de9d667eb81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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