2013年8月25日 星期日

[Android] rating bar size

Error

使用 minHeight and maxHeight 會切掉星星。


Solution

android:scaleX="0.8"
android:scaleY="0.8"

可以縮小 但效果不佳 難以控制位置

最好的方式 直接使用希望呈現的大小圖片



* Reference
- How to set the custom size of the stars in RatingBar
- android ratingbar size

[SQL] Index

in, like 不會使用 index


[Android] tag requires a 'drawable' attribute or child tag defining a drawable

Error Message

想在 selector 中使用顏色做為 drawable

<item> tag requires a 'drawable' attribute or child tag defining a drawable


Solution

要放在 /res/color/list_item_selector.xml



   
   
   
   





[Android] Could not open Selected VM debug port (8700). Make sure you do not have another instance of DDMS or of the eclipse plugin running....

Error Message

Could not open Selected VM debug port (8700). Make sure you do not have another instance of DDMS or of the eclipse plugin running. If it's being used by something else, choose a new port number in the preferences.



Solution

Window -> Preferences -> Android -> DDMS

- Set Base local debugger port to "8601"
- Check the box that says "Use ADBHOST" and the value should be "127.0.0.1"


[Android] The connection to adb is down, and a severe error has occured....

Error Message

The connection to adb is down, and a severe error has occured.
You must restart adb and Eclipse.
Please ensure that adb is correctly located at 'D:\sdk\platform-tools\adb.exe' and can be executed.


Solution

找到工作管理員中的 adb.exe 執行中的 process
關閉 adb.exe
重啟 eclipse



* Reference
- Android故障排除_The connection to adb is down, and a severe error has occured.
- Android : The Connection To Adb Is Down, And A Severe Error Has Occurred.

[SQL] ORA-00932: 不一致的資料類型: 應該是 -, 但為 CLOB

Error Message

ORA-00932: 不一致的資料類型: 應該是 -, 但為 CLOB



Solution

當 field type is lob

可以寫

... where field like xxxx

但不能寫成

... where field = xxxx




[Android] Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY

Error Message

Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY


Solution

在 local 設定 external build path 使用 library xxxx

並在 AndroidManifest.xml 宣告

<uses-library android:name="xxxx">

使用系統上共用的 library.


[Spring] Neither BindingResult nor plain target object for bean name ''

Error Message

RequestContextAwareTag.java org.sprin
rk.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:86) ERROR - Neither BindingResult nor plain target object fo
ame 'loginForm' available as request attribute
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'loginForm' available as request attribute
at org.springframework.web.servlet.support.BindStatus.(BindStatus.java:141)
............
............
............



Solution

因為沒有指定 jsp form modelAttribute 所對應的物件

ex:

// Controller
public String login(Map model) {
model.put("login", new new LoginForm());
}


// JSP
<form:form method="POST" modelattribute="login">


* Reference
- Neither BindingResult nor plain target object for bean name available as request attribute
- Spring MVC – Neither BindingResult Nor Plain Target Object For Bean Name ‘Xxx’ Available As Request Attribute.

[Android] AdapterView


  • after set adapter default select position 0.
  • 若被選的位置和原本的相同 那麼不會觸發 onItemSelected.

  • setSelection(position)
    • position 那個 item 會被移動到 top (not touch mode)
  • getChildAt(index)
    • index: 畫面的位置。
    • 所以如果 index 是在不可視的位置 可能會得到 null。



* Related post:
[ListView] The World of List View
[Android] ListView Tips