zoheb hassan wrote:Saurabh you did implement the OnClickListener as an anonymous class and the click just works fine.
How do you figure that? The post states that the logging statements are not being executed - so the button click does not "work just fine". Furthermore, how do you infer that code runs on Android 2.2, or in an emulator? None of that is mentioned in the post.
How do you figure that? The post states that the logging statements are not being executed - so the button click does not "work just fine".
Hey Tim well i did mention that i ran the code myself and the log statements do execute fine unless he tied his OnClickListener to an another button which may not be the case and the implementation however was right i.e., listening for a button click and firing an intent. Looking at the code one can infer that the guy was using an EdiText to take an input location and on click of an button wanted to display on map the location the user Input.
What i am not clear tough is whether you were asking a question or asserting the above statement
Furthermore, how do you infer that code runs on Android 2.2, or in an emulator? None of that is mentioned in the post.
Because the only place this code would fail is on an android emulator with no google apis.If the same code was being run on an actual device or an emulator with google api it would not fail and hence the statement was made.His implementation or the code was all right only issue here was running it on an emulator not meant for it
i ran the code myself and the log statements do execute fine
Well, we don't know what code you ran, but we have to believe Saurabh Pillai when he says that his code is not logging anything, and thus does not work fine. (And no, I'm not asking, I'm making a statement.)
Because the only place this code would fail is on an android emulator with no google apis.
The code appears not even to run, so it's too early to make assumptions about why it fails. There are plenty of devices that do not have the Google APIs, by the way, not just the emulator. Those devices *may* have other software that knows what to do with a "geo:" URI, or they may not. (And I still don't see where the "Android 2.2" comes from.)
As a general rule, I'd put an @Override annotation before each method that is supposed to override (or implement) a superclass (or interface) method. That habit will save you lots of time, even if it's not the problem here.
Zoheb was right. I was running it against Android emulator as opposed to Google API emulator. I changed it to proper emulator and it works just fine.
Also, I was wrong about logging-statements-not-being-printed or I should say I was looking at the wrong place. I was looking at Console opposed to LogCat. But I did not know anything about DDMS when I posted this question. I read about it now and now I know something.
But it is really frustrating that emulator take really long (10 minutes for Google API level 8 emulator). How long does it take for you guys?
Thank you for your inputs.