Fix ClassCastException in  sample app

Fix ClassCastException in  sample app when it's running in Android 5.0。