Android layout doesn't "refresh" until I start a new activity -


i have problem. wrote program , have code in mainactivity class:

    button.setonclicklistener(new view.onclicklistener() {         @override         public void onclick(view v) {             intent activity = new intent(mainactivity.this, anotheractivity.class);             startactivity(activity);             output.settext(object.tostring());         }     }); 

in anotheractivity modify object , after activity ends (with finish()) want "refresh" textview of mainactivity. @ end of anotheractivity object modified, text not refreshed. if click again on button, before new activity started (with layout) text refreshed should, , if close anotheractivity layout, text refreshed. if don't click again button, text remains old one. how can do? sorry bad english or bad explanation.

you can use onresume() in first activity update ui when second activity finished.

either or start second activity startactivityforresult call onactivityresult when second activity finished.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -