How to ESC and QUIT app on Android?
Monkey Targets Forums/Android/How to ESC and QUIT app on Android?
| ||
Is there any command available in monkey to quit an app running on an android device? Usually the back button on the phone quits most applications. But with monkey apps, I need to hit the home key and force quit through the phones task manager. Which is annoying. |
| ||
There should be at least something like OnSuspend() or anything else to get notified about an application switch. Quitting an application could be done via a simple exit button I guess so something you have to implement. |
| ||
Implementing a quit button is no problem. But what command to use that actually quits the monkey app is what I cant find in the documentation. Is there such a command at all? Edit: Deleted those snippets. No need to confuse the public with non existent commands :) |
| ||
Yes they wont because that OnSuspend was just an enhancement idea. ;) |
| ||
Lol I see :) Being able to quit the app properly is a welcome enhancement :) |
| ||
I have thought about that but still see no way of properly exiting an app on Android. Same is true for iOS as far as I can see... |
| ||
I lack the practical knowledge in this field. But could we teoretically add this functionality ourself as a monkey module? |
| ||
Yes. But you have to implement the native part for this. |
| ||
I found a solution: http://www.monkeycoder.co.nz/Community/post.php?topic=193&post=1342 |
| ||
Didnt realize you could import java files directly like this. Way cool! So this will not break with future monkey updates? |
| ||
I think it is pretty standard Monkey code, so I don't see any reason why it should break in future Monkey versions. |