活動(dòng)
Eclipse的代碼助手與快速補(bǔ)全(alt+/)
助手windows—preferense—Java—editor—content—倒數(shù)第二行把26個(gè)字母補(bǔ)全(不刪.)。
步驟1:(1)activity(一個(gè)頁(yè)面)
(2)layout(頁(yè)面布局)
(3)res(頁(yè)面內(nèi)的資源(drawable))
注:按照上次課建新project(但不自動(dòng)生成圖標(biāo)與activity)。
確定版本android:versionName="1.0.0"
改圖標(biāo)android:icon="@drawable/logo"
復(fù)制包名com.example.dongzhen
繼承父類android.app.Activity
調(diào)用onCreate
Layout下創(chuàng)建Android xml file(名稱不允許大寫)。
設(shè)置背景android:background="@drawable/lbg">
注冊(cè)包,否則安裝后會(huì)有沒(méi)注冊(cè)警告
<activity
? ? ? ? ? ?android:name=".dongzhen1"
? ? ? ? ? ?android:label="@string/app_name" >
? ? ? ? ? ?<intent-filter>
? ? ? ? ? ? ? ?<action android:name="android.intent.action.MAIN" />
? ? ? ? ? ? ? ?<category android:name="android.intent.category.LAUNCHER" />
? ? ? ? ? ?</intent-filter>
? ? ? ?</activity>
</application>
創(chuàng)建命令按鈕
<Button
? ? android:layout_width="wrap_content"
? ? android:layout_height="wrap_content"
? ? android:text="切換到下一頁(yè)" ?
? ? ? ?></Button>
控件注冊(cè)android:id="@+id/button"
綁定控件Button并強(qiáng)制轉(zhuǎn)換button=(Button) findViewById(R.id.button);
建立第二頁(yè)(方法同上)
對(duì)按鈕寫監(jiān)聽頁(yè)面跳轉(zhuǎn)
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
}
});
通過(guò)intent進(jìn)行跳轉(zhuǎn)
Intent intent=new Intent(dongzhen1.this,dongzhen2.class);
startActivity(intent);
步驟2:裝飾
步驟3:交互(按鈕等)
步驟4:(1)線性布局 (2)相對(duì)布局
步驟5:(1)簽名 ?(2)打包 ?(3)發(fā)布
總結(jié):版本號(hào)、版本名稱的修改
應(yīng)用名、圖標(biāo)的修改
聲明首頁(yè)
布局

