Me and my friend Eugeniu Arbuleac had the pleasure to present an Introduction to Android development course at Google Developers Group Bucharest first 2013 meetup.
time run D/MyActivity( 1146): onClickAnotherActivity D/MyActivity( 1146): onPause D/MyActivity( 1146): onStop D/MyActivity( 1146): onRestart D/MyActivity( 1146): onStart D/MyActivity( 1146): onResume Open another activity, then Back button Activity Lifecycle
public class MyService extends Service { static final String TAG = MyService.class.getSimpleName(); @Override public IBinder onBind(Intent arg0) { return null; } @Override public void onCreate() { Log.d(TAG, "onCreate"); } @Override public int onStartCommand(Intent intent, int flags, int startId) { Log.d(TAG, "onStartCommand"); return START_STICKY; } @Override public void onDestroy() { Log.d(TAG, "onDestroy"); } } Service Example
public class Receiver extends BroadcastReceiver { static final String TAG = Receiver.class.getSimpleName(); @Override public void onReceive(Context context, Intent intent) { Log.d(TAG, "onReceive action: "+intent.getAction() ); } } Broadcast Receiver Example