Programming/Android Android file share 생각하는로뎅 2013. 4. 10. 22:58 반응형 String path = Environment.getExternalStorageDirectory() .getAbsolutePath() + "/StopWatch_jinisoftware"; File file = new File(path + "/abc.txt"); MimeTypeMap map = MimeTypeMap.getSingleton(); String ext = MimeTypeMap.getFileExtensionFromUrl(file.getName()); String type = map.getMimeTypeFromExtension(ext); if (type == null) type = "*/*"; Intent intent = new Intent(Intent.ACTION_SEND); Uri data = Uri.fromFile(file); intent.setType("text/rtf"); intent.putExtra(Intent.EXTRA_STREAM, data); startActivity(Intent.createChooser(intent, getResources() .getString(R.string.share_title))); 반응형