I have tried many different ways or solutions and none of them seems to work. I have tried a few specific solutions which returns me a string and a context but i do not know what to do with the context
even if I set the receiver of the context
as null the app returns an error. What I want to do is, to be able to upload an image file
for that I need the file path, a Uri or a content Uri gives me addresses like this
Content://something_something/304:
But i need something like this " storage/sdcard/something_something/304.jpg"
how do it get that in KITKAT
?
This is the code/method that I use for getting the path to the selected user Image.
public String getPath(Uri uri)
{
String[] projection = { MediaStore.Images.Media.DATA };
Cursor cursor = getContentResolver().query(uri, projection, null, null, null);
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}
hope i provided enough details. Thank you for any help.