編輯:關於android開發
關鍵代碼如下:
public class MainActivity extends Activity {
private String msg="Android: ";
/**
* Called when the activity is first created.
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.d(msg, "The onCreate() event");
}
/**
* Called when the activity is about to become visible.
*/
@Override
protected void onStart() {
// TODO Auto-generated method stub
super.onStart();
Log.d(msg, "The onStart() event");
}
/**
* Called when the activity has become visible.
*/
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
Log.d(msg, "The onResume() event");
}
/**
* Called when another activity is taking focus.
*/
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
Log.d(msg, "The onPause() event");
}
/**
* Called when the activity is no longer visible.
*/
@Override
protected void onStop() {
// TODO Auto-generated method stub
super.onStop();
Log.d(msg, "The onStop() event");
}
/**
* Called just before the activity is destroyed.
*/
@Override
protected void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
Log.d(msg, "The onDestroy() event");
}
}
運行截圖:
當Activity第一次打開時:
當啟動另一個Activity時:
當關閉當前的Activity,返回到先前的Activity時:
當銷毀當前Activity時:
Android App 開發技能圖譜,androidapp 操作系統 Windows/MacOSX/Linux 編程語言 Java HTML/JS (Hybrid/
Android 加載大圖片到內存,本文演示android中圖片加載到內存 首先設計界面: 代碼如下: <LinearLayout xmlns:android=h
Kotlin的擴展函數:擴展Android框架(KAD 08),kotlinandroid作者:Antonio Leiva 時間:Jan 11, 2017 原文鏈接:ht
dagger2記錄篇,dagger2記錄作為一個碼農,什麼都不用多講,貼代碼 build project build module Application pub