android - OnActivityResult() is never called -


this how start tab activity

  intent = new intent("walk.me.tab");         startactivityforresult(i, static_result); 

note: static_result=-1 or result_ok;

this how finish tab activity

((button)viewitem.findviewbyid(r.id.gotherefav)).setontouchlistener(new ontouchlistener(){      @override     public boolean ontouch(view v, motionevent event) {          if(ime!=null)         {          b.putstring("ime",ime.tostring());         b.putintarray("koordinati&kategorija", coordandcat );          b.putboolean("klik", true);          finishwithresult(b);         }         return false;     }});    public void finishwithresult(bundle b) {     intent = getintent();     i.putextras(b);     setresult(activity.result_ok, i);      log.i("in finish", "settig activity result");       finish();    } 

and here onactivityresult implementation:

@override     protected void onactivityresult(int requestcode, int resultcode, intent data) {           log.i("in onactivityresult", "activity result");             toast.maketext(getbasecontext(), "dojde", toast.length_long).show();         super.onactivityresult(requestcode, resultcode, data);            log.i("in onactivityresult", "activity result");           if (requestcode == static_result) {                  if (resultcode == result_ok) {             toast.maketext(getbasecontext(), "dojde bundle", toast.length_long).show();            bundle preferenciodtab = data.getextras();            if(preferenciodtab !=null && preferenciodtab.getboolean("klik", true))                   {                     mapview = (mapview)findviewbyid(r.id.map);                      isfavorite=preferenciodtab.getboolean("klik");                   drawfavorite(preferenciodtab.getstring("ime"),preferenciodtab.getintarray("koordinati&kategorija"));                   }                  }} 

why onactivityresult never called goes directly onresume() regardless of documentation garantees oar called before or? i'm doing wrong? dont have stated in manifest xml

singleinstance

or

singletask

for main activity...

you static_result -1?

the requestcode has positive integer.

startactivityforresult()

parameters

intent intent start.

requestcode if >= 0, code returned in onactivityresult() when activity exits.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -