Hi, all.
I import Chapter_4_To-do_List_Part_2 example to Eclipse. All work fine with some modification of minSdkVersion, by default in the project this value is 4, and Eclipse advice me add.
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
in ToDoListActivity.java file, thats no matter...
But, when change
android:minSdkVersion="4"
to
android:minSdkVersion="17"
into AndroidManifest.xml
in my nexus 4, enter key does not work as expected... it mean edittext field expand (like textarea in html), and Log.v(...) in the method of file NewItemFragment.java
PHP Code:
myEditText.setOnKeyListener(new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
Log.v("NewItemFragment", "keyCode:: " + keyCode);
if (event.getAction() == KeyEvent.ACTION_DOWN)
does not executed.
but with api level 11, it's work fine.
and with api level 4 and @TargetApi(Build.VERSION_CODES.HONEYCOMB) (ToDoListActivity.java), edittext field styled not same like in api level 11 %) and work fine.
q: why setOnKeyListener does not work with api level 17? (if i develop app only or greater api level 17?)
q: and why edittext style distinguish between api levels? (optional)
Thanks in advance.
p.s. Thanks for the Book.