Skip to content Skip to sidebar Skip to footer

Null When Trying To Parse Uri From String Path

I'm using this FileUtils class to handle the Uri: public class FileUtils { private FileUtils() { } private static final String TAG = 'FileUtils'; private static final boolean DEBU

Solution 1:

The Crash is probably occurred due to null String on mStringFilePath = getIntent().getStringExtra("videoUri"); since getIntent().getStringExtras() won't throw nullpointerexception if there isn't a value for the requested Extras but also won't give a data to the assigned variable the final result of the mStringFilePath will be null to fix this issue make sure that the given String for the uri parse is wrapped in:

if(mStringFilePath != null){ mVideoUri = Uri.parse(mStringFilePath); }

Post a Comment for "Null When Trying To Parse Uri From String Path"