String photoPath = null; if((photoPath = _dataProcess.getText("url", null)) == null ) return; Cursor c = context.getContentResolver().query(Uri.parse(photoPath), null, null, null, null); c.moveToFirst(); String path = c.getString( c.getColumnIndex(MediaStore.MediaColumns.DATA)); Uri uri = Uri.fromFile( new File(path)); c.close();
android에서 Uri를 알고 있고 절대경로(파일경로)를 알애야 할 때 위 처럼 하면 된다.
'MISCELLANEOUSNESS' 카테고리의 다른 글
Android ImageView 여백에 투명효과 주기. (0) | 2011.01.09 |
---|---|
사용기] 장갑끼고 모바일 기기를 조작해야 한다면 Alupen (0) | 2011.01.01 |
Android WakeLock 화면, 키보드 항상 켜지게 수정하기. (0) | 2010.11.27 |