1 listview android:cacheColorHint,android:listSelector屬性做用 ListView是經常使用的顯示控件,默認背景是和系統窗口同樣的透明色,若是給ListView加上背景圖片,或者背景顏色時,滾動時listView會黑掉, 緣由是,滾動時,列表裏面的view重繪時,用的依舊是系統默認的透明色,顏色值爲#FF191919, 要改變這種狀況,只須要調用listView的setCacheColorHint(0),顏色值設置爲0 或者xml文件中listView的屬性 Android:cacheColorHint="#00000000"便可, 滾動時,重繪View的時候就不會有背景顏色。 android:listSelector="#00000000" 進行上面的設置以後,ListView點擊item時就沒有任何現象了, 2 項目運行時出現錯誤:html
# A fatal error has been detected by the Java Runtime Environment: # # Internal Error (classFileParser.cpp:3494), pid=7480, tid=7376 # Error: ShouldNotReachHere() # # JRE version: 6.0_29-b11 # Java VM: Java HotSpot(TM) 64-Bit Server VM (20.4-b02 mixed mode windows-amd64 compressed oops) # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp #
解決辦法: 1.選中junit測試類,右鍵 -> Run As -> Run Configurations... 2.切換到Classpath選項欄,刪掉Bootstrap Entries裏面的Android Library,而後點擊右側的Advanced.. -> Add Library -> JRE System Library,一路next便可。java
這時再運行該類,就能正常運行了。android
3 .經過字符串拼湊的html頁面顯示: test_day_question.loadDataWithBaseURL(null, title, "text/html", "utf-8", null);web
4 要阻止Android改變你的Activity的呈現方向,你所要作的僅僅是在AndroidManifest.xml中添加一行代碼: android:screenOrientation = "portrait"(豎)或"landscape(橫)"。sql
5shell
<「uses-permission android:name="android.permission.VIBRATE"></uses-permission」> 震動權限數據庫
6 button經過程序觸發click事件 onlinetest_changeone.performClick(); 2013-04-15:windows
1, 數字轉大寫字母: for (byte b : ("1").getBytes()) {
rdoAddress.setText(((char) (b + 48)+"").toUpperCase()); // System.out.print(((char) (b + 48)+"").toUpperCase());
}app
2.adb鏈接手機,pc端管理員權限打開cmd,輸入adb shell回車,而後su,手機端提示獲取管理員權限,選擇確認,就能夠操做手機上的sqlitewebapp
3.android 2.3使用adb出現「sqlite3:not found」解決辦法: 導出sqlite3報錯「Failed to pull selection」 權限問題 adb remount 而後提示:cannot create 'D://': Is a directory 不能導出到電腦,因此就先把文件放到mnt//sdcard//下面,而後再從mnt//sdcard//下導出 語句:adb pull /system/xbin/sqlite3 mnt//scard// 導出成功 把電腦上的sqlite3導入到手機:提示"Failed to push selection: Permission denied" 而後查找資料,運行命令以下 # adb shell # su #mount #mount -o rw,remount -t yaffs2 /dev/block/mtdblock1 /system #chmod 777 /system/xbin 倒入成功,修改sqlite3的權限# chmod 4755 /system/bin/sqlite3
4 .經過adb打開數據庫,會一直提示Error: unable to open database "XX": unable to open database file, 而後就一路下去把權限都給改了chmod 4755,一直改到數據庫,再操做就能夠打開了
5..head on #顯示錶頭
20130418
1.listview滑動陰影去除:android:fadingEdge="none",listview下劃線不顯示:android:divider="@null"
20130419
1.修改RadioGroup樣式:
第一步:新建res->drawable->radiobutton.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@android:drawable/radiobutton_on_background" android:state_checked="true" android:state_enabled="true"/> <item android:drawable="@android:drawable/radiobutton_off_background" android:state_checked="false" android:state_enabled="true"/> </selector>
第二步:在RadioButton空間裏設置屬性 android:button="@drawable/radiobutton"
20130424
1,LinearLayout中動態加載FrameLayout:
<!-- lang: java --> View child = LayoutInflater.from(this).inflate(R.layout.test_assess_item, null); <!-- lang: java --> ((TextView) child.findViewById(R.id.test_assess_analysis)).setText(forNumberAnalysis((cursor.getInt(3)*100)/cursor.getInt(2)));//分析 test_assess_subject_list.addView(child);
添加一直報錯,覺得LinearLayout中不能動態加載FrameLayout,問了同窗才知道原來數據庫表取數據報錯,艹,鄙視下本身