Check Out

Upcoming submissions (Wiki CFP)

Loading...

Recent Posts

Life cycle of an Android activity

Activity is an abstraction of "User screen."

An application is one or more activities plus a Linux process to contain them. The activity life cycle is not tied to the process life cycle. Processes are just disposable containers for activities. You do not have control over what state your program is in. That’s all managed by the system. However, you do get notiļ¬ed when the state is about to change through the onXX () method calls.
So, it's time to override thses event methods like this.
package sample;
import android.app.Activity;
import android.os.Bundle;

public class Sample extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}

0 comments:

Post a Comment