۱۳۹۵/۰۱/۳۱, ۱۲:۵۸ ق.ظ
(۱۳۹۵/۰۱/۳۰, ۱۰:۲۵ ب.ظ)ail603601 نوشته: من پروژه اندروید ما را برسی کردم اما کدی خاصی برای این اقدام پیدا نکردم!
این کدی که بت میدم عالیه امتحانش کن ایشالا مشکلت حل میشه
کد:tring type = "image/*";
String filename = "/myPhoto.jpg";
String mediaPath = Environment.getExternalStorageDirectory() + filename;
share(type, mediaPath);
private void share(String type, String mediaPath){
// Create the new Intent using the 'Send' action.
Intent share = new Intent(Intent.ACTION_SEND);
// Set the MIME type
share.setType(type);
// Create the URI from the media
File media = new File(mediaPath);
Uri uri = Uri.fromFile(media);
// Add the URI to the Intent.
share.putExtra(Intent.EXTRA_STREAM, uri);
// Broadcast the Intent.
startActivity(Intent.createChooser(share, "Share to"));
}
یاعلی
اینو دقیقا کجا بنویسم؟