Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 8th, 2013, 12:26 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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 12:30 PM.
Reply With Quote
  #2 (permalink)  
Old December 18th, 2013, 08:08 AM
Registered User
Points: 15, Level: 1
Points: 15, Level: 1 Points: 15, Level: 1 Points: 15, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 26th, 2013 12:55 AM



All times are GMT -4. The time now is 07:44 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.