Add example code

From <<Beginning Android 4>>