keepRunning PhoneGap/Cordova

后端 未结 2 1939
伪装坚强ぢ
伪装坚强ぢ 2020-12-06 18:59

Anyone can explain me how keepRunning works in the config.xml for Android.

I mean, I don\'t want to know how to write the instruction but how does it work, how does

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-06 19:34

    Perfect answer, helped me a lot! I was searching for the solution to the problem for 2 days now.

    In my case I'm currently developing a cordova plugin for login purposes. For the login I use an external form which I load in a webview. For two days now I was struggling with the fact that the "Password forgotten" link and every other link on the page I loaded was working, but I wasn't able to submit my form. Only when I hit the back button and through this finished the intent holding the webview, it did submit and proceed.

    Turns out that the keepRunning handling was the only problem here. In the end I replaced: `

    cordova.startActivityForResult(this, intent, 0);
    

    by:

    cordova.setActivityResultCallback(this);
    cordova.getActivity().startActivityForResult(intent, 0);
    

    which basically fulfills the whole job Cordova's startActivityForResult would do The only thing that's left out is the whole keepRunninghandling which messed up my plugin in the first place.

    Thanks again, Mixaz!

提交回复
热议问题