Skip to content

Instantly share code, notes, and snippets.

@edenizk
Created July 28, 2018 11:58
Show Gist options
  • Save edenizk/e41a05e40041854c460c363f2d07bc1e to your computer and use it in GitHub Desktop.
Save edenizk/e41a05e40041854c460c363f2d07bc1e to your computer and use it in GitHub Desktop.
cycle of android
package com.example.deniz.lifecycle;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toast.makeText(this, "The onCreate Method is Called", Toast.LENGTH_LONG).show();
}
@Override
protected void onStart() {
super.onStart();
Toast.makeText(this, "onStart Method is called",
Toast.LENGTH_LONG).show();
}
@Override
protected void onResume() {
super.onResume();
Toast.makeText(this, "onResume Method is called",
Toast.LENGTH_LONG).show();
}
@Override
protected void onPause() {
super.onPause();
Toast.makeText(this, "onPause Method is called",
Toast.LENGTH_SHORT).show();
}
@Override
protected void onRestart() {
super.onRestart();
Toast.makeText(this, "onRestart Method is called",
Toast.LENGTH_LONG).show();
}
@Override
protected void onDestroy() {
super.onDestroy();
Toast.makeText(this, "onDestroy Method is called",
Toast.LENGTH_LONG).show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment