Android performClick(); | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 11

Android performClick();

With this little piece of code: view.performClick(); you can simulate a click on e.g. a button Can anyone tell me how to do the same with the back button next to the home button?

5th Jan 2018, 11:00 AM
Novas
Novas - avatar
2 Answers
+ 1
There are overriden methods for an app in general, the one you're looking for is: onBackPressed() Alt + Insert -> Overriden Methods -> onBackPressed() Greetings :D
6th Jan 2018, 5:13 AM
jaaxdev
jaaxdev - avatar
+ 11
Thank you, exactly what I was looking for!
6th Jan 2018, 11:20 AM
Novas
Novas - avatar