来自URI的TableLayout背景

时间:2010-10-23 20:32:09

标签: android background tablelayout

如何在tablelayout上使用带有URI的setBackgroundDrawable方法?

1 个答案:

答案 0 :(得分:0)

 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);
    }