android - How to tap / click at x,y position automatically? -
i have created 1 alertdialog
ok , cancel button's in application, when ever alert dialog opened. have tap/click on ok button automatically without user interaction, have x,y position of ok button.
how implement please share me, main requirement how tap @ particular position (x, y) automatically out user interaction .
just call performclick()
method. see view docs reference.
button button = (button) findviewbyid(r.id.mybutton); button.performclick();
or, if developing ice cream sandwich (api level 15), callonclick()
method added. performclick()
more suitable needs, though.
for alert dialog interface positive button, can use: suggested @mike
dialogtoclick.getbutton(alertdialog.button_positive).performclick();.
Comments
Post a Comment