Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling onResume in Android's activity

is it ok in an activity's procedure to force the onResume event by calling this.OnResume() ? Or should I implement another procedure that's called by both OnResume and by the first member ?

like image 914
xain Avatar asked May 16 '11 00:05

xain


People also ask

When onResume () method is called?

onResume() will always be called when the activity goes into foreground, but it will never be executed before onCreate() .

What is onResume () in android?

onResume() is called whenever you navigate back to the activity from a call or something else. You can override the onResume method similarly as onCreate() and perform the task. – Jibran Khan.

What is difference between onStart and onResume?

onStart() -> called when the activity becomes visible, but might not be in the foreground (e.g. an AlertFragment is on top or any other possible use case). onResume() -> called when the activity is in the foreground, or the user can interact with the Activity.

Is called when the activity is no longer visible to the user?

onStop. called when activity is no longer visible to the user. onRestart. called after your activity is stopped, prior to start. onDestroy.


1 Answers

Implement another procedure that's called in your override of onResume(). The latter is not intended to be called by you, it's a convenience method that tidies up or readies the activity when its state changes to resume. A lot like onCreate() through to onDestroy().

like image 52
SK9 Avatar answered Sep 27 '22 22:09

SK9