jhdj
jhdj

Reputation: 631

Phonegap android exit app not working

Using phonegap 2.5.0 but the exit app always gives object has no method exitApp

used navigator.device.exitApp()

Is this depreciated? or am I just using it wrong

Thanks

Upvotes: 2

Views: 5565

Answers (3)

Abdulkader
Abdulkader

Reputation: 1

you could use BackButton.exitApp();

Upvotes: 0

Suhas Gosavi
Suhas Gosavi

Reputation: 2170

You can use this condition

 if (navigator.app) {
            navigator.app.exitApp();
        }
        else if (navigator.device) {
            navigator.device.exitApp();
        }

this works fine. No version Problem.

Upvotes: 4

Sunil Kumar
Sunil Kumar

Reputation: 1796

You need to use navigator.app.exitApp();

Upvotes: 5

Related Questions