nikhilmuz / WhatsApp-Bulk-Sender

Send bulk messages right from your WhatsApp Android Client or WhatsApp Web
MIT License
241 stars 120 forks source link

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

Closed nikhilmuz closed 4 years ago

nikhilmuz commented 4 years ago

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 https://github.com/nikhilmuz/WhatsApp-Bulk-Sender/issues/13#issuecomment-474658800

nikhilmuz commented 4 years ago

Commit #8c2666acf5fe708d74e9768869729b51f24aeb01 fixed this issue.