原创 android學習筆記之layout
Android有4種Layout:LinearLayout(TableLayout爲其子類),FrameLayout,AbsoluteLayout,RelativeLayout. Layout中Item所共有的XML屬性:(1)la
原创 android學習之setBackgroudColor()…
自己調顏色 button.setBackgroundColor(Color.argb(0xFF, 0xFF, 0x99, 0x00));四個參數依次爲透明度,紅,藍,綠。
原创 android學習之獲得電池電量
private void monitorBatteryState() { batteryLevelRcvr = new BroadcastReceiver() { public void onReceive(Conte
原创 android學習之AlterDialog實例
@Override protected Dialog onCreateDialog(int id){ switch(id){ case DIALOG_OP: final String[] op=getRe
原创 android學習之startActivityForRes…
如果想在Activity中得到新打開Activity 關閉後返回的數據,需要使用系統提供的startActivityForResult(Intent intent, int requestCode)方法打開新的Activity,新的Ac
原创 android學習之屏幕劃線
//新建一個類繼承View public class Drawl extends View{ private int mov_x;//聲明起點座標 private int mov_y; private Paint paint;//
原创 android學習之popupWindow
private void initPopWindow() { // 加載popupWindow的佈局文件 View contentView = LayoutInflater.from(getApplicationContex
原创 android學習筆記之Fragments
Fragments 誕生初衷 自從Android3.0中引入fragments的概念,根據詞海的翻譯可以譯爲:碎片、片段。其上的是爲了解決不同屏幕分辯率的動態和靈活UI設計。大屏幕如平板小屏幕如手機,平板電腦的設計使得其
原创 android之intent.setFlag
一. intent.setFlags()方法中的參數值含義: 1.FLAG_ACTIVITY_CLEAR_TOP:例如現在的棧情況爲:A B C D 。D此時通過intent跳轉到B,如果這個intent添加FLAG_ACTIVITY
原创 android學習之SimpleDateFormat
public class SimpleDateFormat extends DateFormat SimpleDateFormat 是一個以國別敏感的方式格式化和分析數據的具體類。 它允許格式化 (date -> text)、語法分析
原创 OpenGL學習一OpenGL學習資源
OpenGL學習資源 重點推薦:www.opengl.org:opengl的官方網站,內容豐富,學習opengl知識的百寶箱,聖地。 重點推薦:http://nehe.gamedev.net/: NeHe網站的opengl教程,
原创 android學習之USB監聽
IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(Intent.ACTION_MEDIA_REMOVED); intentF
原创 android學習之State List
關於listview和button都要改變android原來控件的背景,在網上查找了一些資料不是很全,所以現在總結一下android的selector的用法。 首先android的selector是在drawable/xxx.xml
原创 android學習之OptionsMenu
import android.os.Bundle; import android.app.Activity; import android.graphics.Color; import android.view.Menu; impor