p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning Android Application Development (http://p2p.wrox.com/forumdisplay.php?f=631)
-   -   chapter2-using startActivityForResult (http://p2p.wrox.com/showthread.php?t=90028)

ArunKarkare May 10th, 2013 04:19 AM

chapter2-using startActivityForResult
Many Thanks to author for such a nice book for novice Android learners like me. I have understood how 'startActivity' method works for starting second activity from first activity, and the program works fine. However though I have understood how the 'startActivityForResult' method works, but when I try to run the program nothing happens in the emulator after I click on keypad center button...I have thoroughly checked and ensured that in manifest file, main.java, main.xml, activity2.java and activity2.xml there are no mistakes in writing the code...can the experts guide me please? [:confused:]---arun karkare

Nik_Pro May 19th, 2013 03:38 PM

Code Issue
Hello ArunKarkare,
I also encountered the same issue with the program and i changed it a bit to see the working. After changing the working is the same as described in the book. In the book the textView, EditText and the Button component are added to the main.xml but Activity2.xml file is shown in the image which consists of all this.

I am providing you the link to the file which i modified to make it work.I have added a button and used that to navigate to the other activity instead of using the DPAD action.
The target SDK for that is 2.3.3 API 10... You can download it and test it...

Almost all the code for the java files remains the same except for the button action only.....


I hope i have helped you solve your issue...


ArunKarkare May 19th, 2013 10:31 PM

chapter2-using startActivityForResult
Hello....Nikhil...many thanks for ur comments, and yes I realized the problem that some portion of the code must have been in Activity2.java that was wrongly included in main.java, also I realized that center-directional-button on emulator does not work, so I used the 'H' key on my laptop keyboard instead...anyway thanks again [:)]....arun karkare

Nik_Pro May 20th, 2013 08:29 AM

Your Welcome Arun...


All times are GMT -4. The time now is 11:19 PM.

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