Wrox Programmer Forums
|
BOOK: Professional Android 4 Application Development
This is the forum to discuss the Wrox book Professional Android 4 Application Development Reto Meier; ISBN: 978-1-1181-0227-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android 4 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 8th, 2013, 11:26 AM
Registered User
 
Join Date: Sep 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter_4_To-do_List_Part_2

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 vint keyCodeKeyEvent 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.

Last edited by j3fff; September 8th, 2013 at 11:30 AM..
 
Old December 18th, 2013, 08:08 AM
Registered User
 
Join Date: Nov 2013
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I just got my Android phone (Moto G with Android 4.3) and noticed the same thing in all To Do-examples:
Pressing "Enter" after filling in some text would just result in a new line instead off adding the new ToDoItem...but only on the actual phone - it still works as advertised in an AVD!

Only changing the targetSdkVersion to 11 corrected the problem so that I could add items on the phone.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Re-install of Chapter_4_To-do_List Part 4 failed... shekar.mahalingam BOOK: Professional Android 4 Application Development 1 July 25th, 2013 11:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.