TableLayout background from URI
-
25-09-2019 - |
Question
How to use the setBackgroundDrawable method on tablelayout with an URI?
Solution
public String getRealPathFromURI(Uri contentUri) {
String[] proj = { MediaStore.Images.Media.DATA };
Cursor cursor = managedQuery(contentUri, proj, null, null, null);
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow