android - onActivityResult not being called when launching another app -
i trying call app through intent, app called onactivityresult not being called. please me on this? below code:
public class encryptcommandactivity extends activity{ encryptionfactory encryptionfactory = new encryptionfactory(); protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.encrpyt_command_activity); activitycontexts.setencryptcommandactivitycontext(this); intent intent = new intent("asd.com.qweapi.main_activity"); bundle bundle = new bundle(); bundle.putint("function", 1006); bundle.putstring("msg", mqttfactory.getbyid()); intent.putextras(bundle); startactivityforresult(intent, 0); finish(); } @override protected void onactivityresult(int requestcode, int resultcode, intent pdata) { super.onactivityresult(requestcode,resultcode,pdata); log.d("encrypt","inside"); //not called toast.maketext(activitycontexts.getmainactivitycontext(),"encrypt", toast.length_long).show(); //not called } }
you should remove finish()
in oncreate()
because finish activity , it's no longer exist, since can not fire onactivityresult()
Comments
Post a Comment