nikhilmuz/WhatsApp-Bulk-Sender

Backpress not working always in Conversation activity so better implementation like clicking of UI button should be used

Closed this issue · 1 comments

List nodes = getRootInActiveWindow().findAccessibilityNodeInfosByViewId("com.whatsapp:id/send");
final List nodesback = getRootInActiveWindow().findAccessibilityNodeInfosByViewId("com.whatsapp:id/back");

            for (AccessibilityNodeInfo nodeInfo : nodes) {
                if (nodeInfo != null) {
                    nodes.get(0).performAction(ACTION_CLICK);
                    Handler handler = new Handler();
                    handler.postDelayed(new Runnable() {
                        public void run() {
                            // Actions to do after 1 seconds
                            for (AccessibilityNodeInfo nodebackInfo : nodesback) {
                                if(nodebackInfo!=null){
                                    nodesback.get(0).performAction(ACTION_CLICK);
                                }
                            }
                        }
                    }, 1000);

                    break;
                }
            }

I managed to do this, performglobalaction don't seem to work all the time, so I perform click on the back button on top left corner of com.whatsapp.conversation UI

Originally posted by @chiaqf in #13 (comment)

Commit #8c2666acf5fe708d74e9768869729b51f24aeb01 fixed this issue.