finish() and android activity lifecycle -


there things don't know android activity lifecycle, don't me started on fragments!:

once method resume() called proceed executed end if finish() or startactivity(new intent(..)) called.

 public void onresume(){        // stuff aaa        ....        startactivity(new intent(..));       // more stuff bbbb        // far?        setresult(result_code, intent);        finish();        // how here? far?        // how make sure started in app finished off well? ie activities started activity finished?  } 

btw, similar top interview question. onpause() still called after finish()? how onstop()?

lastly, know how finish() not mainactivity such activities have started under application, ie started mainactivivity, going application called application.

yes code after call finish() called.

when call finish() next function executed onpause().

if want close activities on stack this:

setresult(result_close_all); finish(); 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -