안드로이드 개발 질문/답변
(글 수 45,052)
프로젝트내 drawable폴더에서 led그림을 intent로 이미지뷰를 호출해 보려고 하는데
이미지뷰프로그램은 호출이 잘되는데 led그림파일을 가져오지 못하는군요 어디가 잘못됐는지
알려주시면 감사하겠습니다.
Uri uri = Uri.fromFile(new File("android.resource://com.force/" +R.drawable.led));
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, "image/*");
try{
startActivity(intent);
}catch( ActivityNotFoundException e ) {
Toast.makeText(getBaseContext(),"application not available", Toast.LENGTH_SHORT).show();
}
아마 이미지 뷰어에서 다른 패키지의 리소스를 가져오지 못해서(권한 관련) 나타나는 현상인거 같네요.
다른 앱에서 접근 가능한 곳(sd카드?)에서 넣어둔뒤에 불러오면 나올거 같은데요?