P149 Overriding Activity Tutorial
OK, a bit of a weird one but it happened to me so it may happen to you...
I couldn't get this tutorial to work on my emulator, there was no response to any clicking of the DPAD as proposed in the tutorial. Eventually I discovered that the DPAD was not enabled in the AVD. Duhhh, don't know why it took me so long to find this out as it was clearly written right next to the DPAD on the emulator.
Anyway, it appears that what gets enabled in your emulator depends on the basic phone that each emulator is modelled upon.
The fix is to find your emulator's config.ini file, in my case this was here - C:\Users\MyName\.android\avd\YourEmulator\ and, by changing the hw.dPad=no entry to hw.dPad=yes my problem was fixed.
I know that this is unlikely to have affected many of you but worth noting and offers some extra homework on understanding what else is in your AVDs config.ini files.
A further bit of bug fixing, 2 points...
1) There's a missing closing curly brace } at the end of the sample code on P150 and,
2) The author has addressed an issue with the DPAD_CENTER button at the foot of P151 but also note that the DPAD_CENTER Toast message only gets displayed when nothing is in focus i.e. neither the EditText field nor either of the BUTTONs.
Last edited by wolfenr; December 14th, 2013 at 08:46 AM..