티스토리 뷰
Intent.ACTION_SEND 이미지 공유 하기
Dexx 2015. 10. 9. 03:491 2 3 4 5 6 7 8 9 10 11 12 | private void shareImage() { Intent share = new Intent(Intent.ACTION_SEND); share.setType("image/*"); // setType("image/png"); OR for jpeg: setType("image/jpeg") String imagePath = Environment.getExternalStorageDirectory() + "/myImage.png"; File imageFileToShare = new File(imagePath); Uri uri = Uri.fromFile(imageFileToShare); share.putExtra(Intent.EXTRA_STREAM, uri); startActivity(Intent.createChooser(share, "Share image to...")); } | cs |
file:///.... 경로를 만들기 위해 String, File, Uri를 이용해 형 변환 함..
'Android 개발 메모' 카테고리의 다른 글
FullScreenMode에서 키보드 활성 시 버튼 위치 변경 - SOFT_INPUT_ADJUST_RESIZE (0) | 2015.10.13 |
---|---|
ViewPager 사용 시 ArrayList 데이터 전달 (0) | 2015.10.09 |
안드로이드, 오늘의 요일 구하기 (0) | 2015.10.01 |
댓글