Exit Navigator (Android) Automatically When External Power is Removed?
  • I'm using Navigator in my car on an Acer B1-780 tablet, and it works great, but I'm trying to find a solution to automatically exit (completely) Navigator when the external power is removed (which happens automatically 3 minutes after I turn off my car). If I leave it running, it consumes too much power. I've tried using Tasker, but Tasker can't close it unless I root my device, which I would rather not do.
  • 6 Comments sorted by
  • This is simply not allowed in Android.
    One app is not allowed to close another app, not via intent and not via broadcast.
    So you do indeed need root to close another app.

  • Of course it can be done via intent. Torque does it. There is an intent you can broadcast that Torque will honour (org.prowl.torque.REQUEST_TORQUE_QUIT). MapFactor could do the same sort of thing (and perhaps it does). It's up to the app to decide if it will close when it sees a particular intent being broadcast.
  • Yes, you are right but that is indeed when the apk you want to stop has that kind of intent. There are more apks supporting that.
    But MNF doesn't have that intent and in that case android does not allow it and I know very few apks having such an intent.

    What you want is a feature request where you can send an intent to MNF to close it from another app.
    And I don't know whether Mapfactor will honor such a request.
  • It would certainly be useful, since as it is now, MFN will drain my tablet's battery if I leave it running when I exit the car.
  • It is possible without intents nor root. I've just created a simple Tasker profile that will quit MFN if the power gets disconnected. You'll need AutoInput though to confirm at the end, which is a paid app after a 7 days trial. 

    Here's an example video. At 0:07 I manually start the task, then it opens and gets (completely) closed with no further input from me.

    Tasker profile setup:

    Condition: State -> Power -> Power -> Any -> Invert

    1. Launch App -> Navigator (This is not necessarily needed if MFN is always running on foreground and never in the background on your device)
    2. Task -> Wait -> ~2 seconds
    3. Input -> Back Button
    4. Task -> Wait -> ~2 seconds
    5. Plugin -> AutoInput -> Action -> Type: Text -> Value: Yes (or whatever it is in your local) -> Action: Click
    Hope it helps!
  • Thanks Cageythree, I will try that. The only trick is knowing whether Navigator is on its home screen, since in that case, one doesn't want to press the back button first.

    EDIT: Reading this again, I think the task you present just exits to the Android home screen, but doesn't actually exit Navigator (you have to tap the Exit button for that).

Howdy, Stranger!


In this Discussion