Restart device from Android App

J Javier Chacon 2 years 11 months ago
62 2 0

Hello everybody!

I'm developing an Android app and need to restart the device using the restart code of StageNow. If I read it from the StageNow app it works correctly, but I want to know if there is any way (via Android Intent, for example) to read the restart code from my app and send it to the StageNow to consume it and restart the device.

Now, I can do it in two steps:
1. Open the StageNow app:
val launchIntent = packageManager.getLaunchIntentForPackage(STAGE_NOW_PACKAGE)
if (launchIntent != null) {
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
startActivity(launchIntent)
finish()
}

2. Scan the reset PDF417 barcode.

There is any way to do it in only one step?

Thanks in advance.

Please Register or Login to post a reply

2 Replies

J Javier Chacon

Thank you so much Richard! This help me a lot.

The final step on the tutorial fails to me (when send the profile update I receive an internal GENERAL_EXCEPTION_OCCURED error), but making some changes finally I got this working.

Thanks again!

CONTACT
Can’t find what you’re looking for?