Get Video Thumbnail from Uri

I want to select a video from my Gallery. It’s working fine. But now I want to display a Bitmap, as a thumbnail.I tried this code and it’s not working, it always says: NullPointerException Bitmap …