I'm trying to display a Snackbar in the screen with some File data that I retrieve in the onActivityResult()
method after taking a photo.
The thing is that the View that is passed to the Snackbar returns null and I cannot display it.
This is the code of the onActivityResult()
method:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == CAMERA_REQUEST_CODE && resultCode == RESULT_OK) {
File f = new File(mCurrentPhotoPath);
if (this.getCurrentFocus() != null)
Snackbar.make(this.getCurrentFocus(), f.length() / (1024 * 1024) + " MB, " + f.getPath(), Snackbar.LENGTH_INDEFINITE).show();
}
}
Any idea why this happen?
Thanks!