This file contains hidden or 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){ |
This file contains hidden or 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
| WearableExtender wearableExtender = new WearableExtender(statusBarNotification.getNotification()); |
This file contains hidden or 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
| List<Action> actions = wearableExtender.getActions(); | |
| for(Action act : actions) { | |
| if(act != null && act.getRemoteInputs() != null) { | |
| RemoteInput[] remoteInputs = act.getRemoteInputs(); | |
| } | |
| } |
This file contains hidden or 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
| notificationWear.pendingIntent = statusBarNotification.getNotification().contentIntent; | |
| notificationWear.bundle = statusBarNotification.getNotification().extras; |
This file contains hidden or 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
| RemoteInput[] remoteInputs = new RemoteInput[notificationWear.remoteInputs.size()]; | |
| Intent localIntent = new Intent(); | |
| localIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |
| Bundle localBundle = notificationWear.bundle; | |
| int i = 0; | |
| for(RemoteInput remoteIn : notificationWear.remoteInputs){ | |
| getDetailsOfNotification(remoteIn); | |
| remoteInputs[i] = remoteIn; | |
| localBundle.putCharSequence(remoteInputs[i].getResultKey(), "Our answer");//This work, apart from Hangouts as probably they need additional parameter (notification_tag?) |
This file contains hidden or 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
| // Usage: | |
| // your share intent | |
| Intent intent = new Intent(Intent.ACTION_SEND); | |
| intent.setType("text/plain"); | |
| intent.putExtra(Intent.EXTRA_TEXT, "some text"); | |
| intent.putExtra(android.content.Intent.EXTRA_SUBJECT, "a subject"); | |
| // invoke custom chooser that contains all apps just without Facebook | |
| startActivity(Tools.customChooserIntentNoFb(intent, "Share using", context)); | |
| // Method: |
This file contains hidden or 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
| private static void writeDynamoMultipleItems(ArrayList<Item> itemsBatchWrite, String tableName, DynamoDB dynamoDB) { | |
| System.out.println("Write to DynamoDB with " + itemsBatchWrite.size() + " items"); | |
| if (itemsBatchWrite.size() > 25) { | |
| System.out.println("Splitting table"); | |
| ArrayList<Item> writeItems = new ArrayList<>(); | |
| for (Item item : itemsBatchWrite) { | |
| if (writeItems.size() < 25) { | |
| writeItems.add(item); | |
| } else { | |
| writeDynamoMultipleItems(writeItems, tableName, dynamoDB); |
OlderNewer