android: turn off screen when close to face

If you are allowed to look at open source code without causing yourself problems, check the source of the Android Phone Application. Specifically src/com/android/phone/PhoneApp.java and src/com/android/phone/InCallScreen.java. From src/com/android/phone/PhoneApp.java: //Around line 519 // Wake lock used to control proximity sensor behavior. if ((pm.getSupportedWakeLockFlags() & PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK) != 0x0) { mProximityWakeLock = pm.newWakeLock( PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK, LOG_TAG); } …. // … Read more

Magento How to debug blank white screen

This is how I got it corrected(Hope will help you guys): Use the following code in your index.php file ini_set(‘error_reporting’, E_ERROR); register_shutdown_function(“fatal_handler”); function fatal_handler() { $error = error_get_last(); echo(“<pre>”); print_r($error); } In my case it tolde me that error/503.php was unavailable. 3.The issue was with testimonial extension I used(http://www.magentocommerce.com/magento-connect/magebuzz-free-testimonial.html) I deleted the testimonial.xml file in … Read more

How to avoid restarting activity when orientation changes on Android

There are various ways to do it, but as given here, using android:configChanges=”keyboardHidden|orientation|screenSize” allows you to listen for the config changes. You then respond to these changes by overriding onConfigurationChanged and calling setContentView. This is the way I’ve been doing it, but I’d be interested to know other people’s thoughts.