android - How to wait for ACTION_DELETE action in asnyctask -


i have following codes :

private class uninstallapptask extends asynctask<string, string, string> {     @override     protected void onpreexecute() {         toast.maketext(getapplicationcontext(), "starting ", toast.length_short).show();     }     @override     protected string doinbackground(string... strings) {         uri uri = uri.fromparts("package", mapplist.get(position).getpackagename(), null);          intent = new intent(intent.action_delete, uri);         startactivityforresult(it, 2);         return null;     }     @override     protected void onpostexecute(string s) {         thread t = new thread(mloadapploadandsortapplist);         t.start();     } }  @override protected void onactivityresult(int requestcode, int resultcode, intent data) {     if (resultcode == result_ok)         toast.maketext(getapplicationcontext(), "succesfull", toast.length_long).show(); } 

when called uninstallapptask, first writes "starting" ran doinbackground doesn't wait activityresult writes "succesfull". want wait close uninstall screen , must write "succesfull".

how can ?


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -