This is my code to upload the video:
Intent shareIntent =new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "Share");
String photoURL="sdcard/DCIM/Camera/20120518_165039.mp4";
File file = new File(photoURL);
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
shareIntent.setType("video/*");
startActivity(Intent.createChooser(shareIntent, "Share"));
When I run it, I choose YouTube to upload and then it will show a error Dialog:
The application My Uploads(process com.google.android.apps.uploader) has stop unexpectedly. Please try aging.
This is log:
Who know how to solve it?
Go to settings> applications> manage applications> all apps> scroll down list to>my uploads (if you can't find> com.google.Android.apps.uploader) clear data
That's all you have to do for any uploads that get stuck on sending but don't finish sending msgs.I founds this answer on Android Forum. The app is called: "my uploads" in my Droid phone settings.
Related
I'm using this code for some years now and it worked fine:
final Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
sharingIntent.setType("audio/mpeg");
sharingIntent.putExtra(Intent.EXTRA_STREAM,
SoundProvider.getUriForSound(getContext(), sound));
getActivity()
.startActivity(Intent.createChooser(sharingIntent,
getContext().getString(R.string.share)));
My SoundProvider generates a URI that starts with content:// which is picked up by a FileProvider (actually the same SoundProvider). This provider reads an audio file from my raw folder.
The sounds was playable directly in WhatsApp (and not a generic file) and shown with the correct title from the ID3 tags.
This has worked flawlessly and still does with Telegram/Dropbox etc. but up until a recent WhatsApp update from a few months ago it fails with the message "Sharing failed please try again".
Is anyone aware of any changes made by WhatsApp and has encountered something similar?
Try this:
Uri uri = Uri.parse(audioPath);
Intent shareIntent = new Intent();
shareIntent.setType("audio/*");
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
I had to work around this by copying the sounds to the external-files-dir.
I don't know why whatsapp suddenly doesn't accept files from the raw directory served by a FileProvider anymore while other apps still do without any problems.
I am very new to this topic how to share my app along with image and text,play store link,my images and text getting from server and image should be not visible after sharing content ,please any one help me how to share this content to other apps like whats app,twitter and more ....
here below my code
File filePath = getFileStreamPath("news_image");
shareIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(filePath));
shareIntent.setType("image/png");
shareIntent.putExtra(Intent.EXTRA_TEXT,
"Here is my IMAGE");
startActivity(Intent.createChooser(shareIntent, "Share IMAGE Using..."))
You should follow the advice from android documentation.
Snippet from the page:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=com.example.android"));
startActivity(intent);
I need to share text and one image from my application via a share intent. I read this article. I thought it would be easy to create share intent. But it is not so easy, because there is a problem with sharing via Facebook.
I need to share some text and one image, which is stored in device. My first attempt looked like this:
The first try
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File("/sdcard/img.jpg")));
shareIntent.putExtra(Intent.EXTRA_TEXT, "My custom text...");
shareIntent.setType("image/jpg");
startActivity(Intent.createChooser(shareIntent, getString(R.string.label_share)));
I tried this code and in applications like Gmail, Google+, Google Keep, etc, everything works fine. But Facebook did not work fine.
There is no my text ("My custom text...") in this screenshot. So I have tried something else.
The second try
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File("/sdcard/img.jpg")));
shareIntent.putExtra(Intent.EXTRA_TEXT, "My custom text...");
shareIntent.setType("text/plain");
startActivity(Intent.createChooser(shareIntent, getString(R.string.label_share)));
And the result of this is here:
There is no text and also no image in this screenshot.
I also tried to change type to image/* and */*, but it did not help. I do not know what is wrong. I just need to share some text and image via Facebook. The first try works well for other applications, but for Facebook not.
Can someone help me, please?
Your first attempt is OK, Facebook does not allow sharing text this way, they say "Pre-filling these fields erodes the authenticity of the user voice."
I am trying to build a messaging app activity. I want to open the attached image in the messaging app but my messaging app is stopping. I have set all the required permissions. The following is my code:
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra("sms_body", "some text");
Uri path = Uri.parse("android.resource://com.works.vipul.imageinmms/"R.drawable.images);
sendIntent.putExtra(Intent.EXTRA_STREAM, path);
sendIntent.setType("image/png");
startActivity(Intent.createChooser(sendIntent,"Send"));
com.works.vipul.imageinmms/" + R.drawable.images);
Add the "+". If that doesn't work, post a stack trace of the crash.
I have read this article:
Sending the User to Another App
If user click on a button, and they should be sent to a video player to watch the video, could anyone please tell me what I should put in the Intent's constructor? I have the path of an mp4 file as String.
try following code
File file=new File(filepath);
Uri uriToFile=Uri.fromFile(file);
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, uriToFile);
shareIntent.setType("*/mp4");
startActivity(Intent.createChooser(shareIntent,"Send to"));