2
份额R.string.share_content
,我有内容或多或少像这怎么可能,我可以有短的URL,如果我通过Twitter通过意向
免费下载从http://www ....
而不是完全的网址,我想有通常在Twitter共享中使用的短URL(lie bit.ly/AbC)?如果通过twitter完成共享,我的应用如何插入短网址?
private void share() {
final String share_subject = getString(R.string.share_subject);
final String share_content = getString(R.string.share_content);
final String share_intent_title = getString(R.string.share_intent_title);
File file = mainView.getScreenshotFile();
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("image/jpeg");
intent.putExtra(Intent.EXTRA_SUBJECT, share_subject);
intent.putExtra(Intent.EXTRA_TEXT, share_content);
// http://stackoverflow.com/questions/5214764/how-to-share-photo-with-caption-via-android-share-intent-on-facebook
intent.putExtra(Intent.EXTRA_TITLE, share_content);
// http://stackoverflow.com/questions/9023116/sharing-an-image-with-google-app-using-intent-action-send-and-intent-extra-stre
ContentValues values = new ContentValues(2);
values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg");
values.put(MediaStore.Images.Media.DATA, file.getAbsolutePath());
Uri uri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
intent.putExtra(Intent.EXTRA_STREAM, uri);
//intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
startActivity(Intent.createChooser(intent, share_intent_title));
}