Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 4

Memahami berbagai kejadian di Activity

Didalam Class Activity (Aktifitas Kelas) sebenarnya


mendefinisikan sejumlah kejadian yang mengatur daur
hidup sebuah activity/pekerjaan semenjak dimulai
hingga berakhir.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);

System.out.println("Kejadian onCreate()berlangsung");
}
public void onStart() {
super.onStart();
System.out.println("Kejadian onStart()berlangsung");
}
public void onDestroy() {
Super.onDestroy();
System.out.println("kejadian onDestroy()berlangsung");
}
public void onPause() {
Super.onPause();
System.out.println("kejadian onPause()berlangsung");
}
public void onRestart() {
super.onRestart();
System.out.println("kejadian onRestart()berlangsung");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
package com.example.kotakcek;

import android.os.Bundle;
import android.app.Activity;
import android.graphics.Typeface;
import android.view.Menu;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;

public class MainActivity extends Activity {


CheckBox kotakCekMiring;
CheckBox kotakCekTebal;
CheckBox textViewHello;

boolean miring = false, tebal = false;


package com.example.kotakcek;

import android.os.Bundle;
import android.app.Activity;
import android.graphics.Typeface;
import android.view.Menu;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;

public class MainActivity extends Activity {


CheckBox kotakCekMiring;
CheckBox kotakCekTebal;
CheckBox textViewHello;

boolean miring = false, tebal = false;

You might also like