Useful snip code in Android development