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
List nodes = getRootInActiveWindow().findAccessibilityNodeInfosByViewId("com.whatsapp:id/send");
final List nodesback = getRootInActiveWindow().findAccessibilityNodeInfosByViewId("com.whatsapp:id/back");
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