ReyLith wrote: > Hi! > > I have a problem with my application. During the execution of it, I > have some buttons which execute other activities when I click on them. > The way I am realising it is: > > private OnClickListener scaleImage = new OnClickListener() > { > public void onClick(View v) > { > Intent intent = new Intent(); > intent.setClass(main.this, Scale.class); > startActivity(intent); > > update(); > } > }; > > The other activity finish it execution using the function finish(). I > have a problem. When the activity finish, the function update() should > be executed. However it doesn't run until I click on other button. I > don't know the reason, the function update() is just bellow of > startActivity.
startActivity() is not a blocking call. As your code is written above, your call to update() happens immediately after you call startActivity(). You may wish to use startActivityForResult(), so you can be notified via onActivityResult() when then other activity has finish()-ed, and you can call update() then. Or, depending on what update() does, you might consider just putting that call in onStart() or onResume(), so you "update" every time your activity comes back to the foreground. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Consulting: http://commonsware.com/consulting -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe, reply using "remove me" as the subject.