Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.states;
- import android.app.Activity;
- import android.app.ProgressDialog;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.Toast;
- public class MainActivity extends Activity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- Toast.makeText(getApplicationContext(), "Activity created", Toast.LENGTH_LONG).show();
- }
- public void click(View v) {
- ProgressDialog pd = new ProgressDialog(this);
- pd.setTitle("Hi, bro");
- pd.show();
- }
- @Override
- protected void onDestroy() {
- Toast.makeText(getApplicationContext(), "Activity destroyed", Toast.LENGTH_LONG).show();
- super.onDestroy();
- }
- @Override
- protected void onStart() {
- Toast.makeText(getApplicationContext(), "Activity started", Toast.LENGTH_LONG).show();
- super.onStart();
- }
- @Override
- protected void onStop() {
- Toast.makeText(getApplicationContext(), "Activity stopped", Toast.LENGTH_LONG).show();
- super.onStop();
- }
- @Override
- protected void onPause() {
- Toast.makeText(getApplicationContext(), "Activity paused", Toast.LENGTH_LONG).show();
- super.onPause();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement