after take a phone, in onActivityResult, data.getData may be null, in this case, try data.getExtras()
Bitmap photo = null;
Uri photoUri = data.getData();
String filePath = "";
if (photoUri != null) {
//mFilePath = getRealPathFromURI(photoUri);
filePath = getRealPathFromURI(photoUri);
photo = BitmapFactory.decodeFile(photoUri.getPath());
}
if (photo == null) {
Bundle extra = data.getExtras();
if (extra != null) {
photo = (Bitmap)extra.get("data");
...