2016-03-21 5 views
0

アプリケーションは正常に存在しますが、まだアクティブなアプリとしてバックグラウンドにとどまっていますか?どのように完全に終了する?PhonegapでAndroidアプリケーションを完全に終了するにはどうすればよいですか?

これは私のコードです:

function showExitDialog() { 
navigator.notification.confirm(
    ("Do you want to Exit?"), // message 
    alertexit, // callback 
    'Exit the application?', // title 
    'YES,NO' // buttonName 
); 
} 


function alertexit(button){ 

    if(button=="1" || button==1 && navigator.app) { 
     navigator.app.exitApp(); 
    } else if(button=="1" || button==1 && navigator.device) { 
     navigator.device.exitApp(); 
    } 
} 

答えて

1

は、そのファイル内cordovaLib/src/org/apache/cordova/app.javaapp.javaファイルを探すあなたは方法が

public void exitApp() { 

     this.webView.postMessage("exit", null); 
     finish(); 
    } 

を、以下のような方法というpublic void exitApp()変更と呼ばれるでしょうが、それはあなたを助けることを願っています。

+0

コメントありがとうございました。しかし、もし私がphonegap builderでそれをオンラインで構築すればどうなるでしょうか? –

+0

私の知る限り、あなたは何の誤りもない –

関連する問題