- [ P ]
使用 SQLite 將 Data Type 設為 String,輸入的數字仍被轉型為 INTEGER,造成手機號碼開頭的零消失。
[ S ]
SQLite 的 Data Type 包括 NULL, INTEGER, REAL, TEXT, BLOB,並無 String,因此輸入的內容會被自動轉型,變成 INTEGER,將 String 改為 TEXT 即可。
REF:
http://www.sqlite.org/datatype3.html
http://garyliutw.blogspot.tw/2013/07/sqlite.html
http://clifflu.blogspot.tw/2008/11/sqlite-sql-2.html - [ P ]
承上,使用 SQLite,於繼承 SQLiteOpenHelper 的 class 中 onCreate method 內已修正 database 各欄位 Data Type 的設定,問題仍未改善。
[ S ]
由於 onCreate method 只有在 database 不存在時才會被 call,故須要將整個 app 從 device 上移除,才會在下次 install 並開啟時,才會以新的設定建立 database。 - [ E ]
android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
[ S ]
http://chroya.iteye.com/blog/724804 - [ P ]
使用 TextView.setHeight(),height 卻沒有改變
[ S ]
textView.getLayoutParams().height = (value here)
REF: http://stackoverflow.com/questions/6963849/textview-setheight-issues - [ P ]
在 layout xml 檔中設定 android:background="@android:color/black" ,但有時出現的顏色卻是灰色。
[ S ]
在 runtime 時再用 textview.setBackgroundColor(Color.BLACK) 設定。
REF:
http://stackoverflow.com/questions/12671430/android-%E2%88%92-black-background-turn-into-grey
http://stackoverflow.com/questions/11901494/textview-and-background-color
2014年3月6日 星期四
[程式] Android - Problems & Solutions PART3
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言