Discussion:
What to do when - java.io.FileNotFoundException: No content provider??
kivy
2010-07-20 09:34:28 UTC
Permalink
Hi everyone,

when I try to attach a file to an email, I get a
java.io.FileNotFoundException: No content provider logcat output. If
anyone could tell me what I am doing wrong or what I should do
instead, that would be great.Thank you.

This is how I add the files to the email..:

Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
sendIntent.setType("video/3gp");
sendIntent.setType("video/mp4");
startActivity(sendIntent);

...and here is the entire logcat error output:

20 09:15:58.364: ERROR/Mms/media(168): IOException caught while
opening or reading stream
07-20 09:15:58.364: ERROR/Mms/media(168):
java.io.FileNotFoundException: No content provider: /sdcard/
Video0006.mp4
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:
507)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.content.ContentResolver.openInputStream(ContentResolver.java:
345)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.MediaModel.initMediaSize(MediaModel.java:268)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.MediaModel.<init>(MediaModel.java:76)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.RegionMediaModel.<init>(RegionMediaModel.java:
40)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.VideoModel.<init>(VideoModel.java:55)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.VideoModel.<init>(VideoModel.java:48)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.data.WorkingMessage.changeMedia(WorkingMessage.java:
434)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.data.WorkingMessage.setAttachment(WorkingMessage.java:
343)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.ui.ComposeMessageActivity.addVideo(ComposeMessageActivity.java:
2472)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.ui.ComposeMessageActivity.addAttachment(ComposeMessageActivity.java:
2544)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.ui.ComposeMessageActivity.handleSendIntent(ComposeMessageActivity.java:
2521)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.ui.ComposeMessageActivity.initialize(ComposeMessageActivity.java:
1703)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.ui.ComposeMessageActivity.onCreate(ComposeMessageActivity.java:
1633)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1047)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2459)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2512)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread.access$2200(ActivityThread.java:119)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.os.Looper.loop(Looper.java:123)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread.main(ActivityThread.java:4363)
07-20 09:15:58.364: ERROR/Mms/media(168): at
java.lang.reflect.Method.invokeNative(Native Method)
07-20 09:15:58.364: ERROR/Mms/media(168): at
java.lang.reflect.Method.invoke(Method.java:521)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-20 09:15:58.364: ERROR/Mms/media(168): at
dalvik.system.NativeStart.main(Native Method)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
DanH
2010-07-20 12:21:30 UTC
Permalink
Well, I can tell you it's looking for the file /sdcard/Video0006.mp4
and not finding it.
Post by kivy
Hi everyone,
when I try to attach a file to an email, I get a
java.io.FileNotFoundException: No content provider logcat output. If
anyone could tell me what I am doing wrong or what I should do
instead, that would be great.Thank you.
Intent sendIntent = new Intent(Intent.ACTION_SEND);
                sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
                sendIntent.setType("video/3gp");
                sendIntent.setType("video/mp4");
                startActivity(sendIntent);
20 09:15:58.364: ERROR/Mms/media(168): IOException caught while
opening or reading stream
java.io.FileNotFoundException: No content provider: /sdcard/
Video0006.mp4
07-20 09:15:58.364: ERROR/Mms/media(168):     at
507)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
345)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
com.android.mms.model.MediaModel.initMediaSize(MediaModel.java:268)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
com.android.mms.model.MediaModel.<init>(MediaModel.java:76)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
40)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
com.android.mms.model.VideoModel.<init>(VideoModel.java:55)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
com.android.mms.model.VideoModel.<init>(VideoModel.java:48)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
434)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
343)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
2472)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
2544)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
2521)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
1703)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
1633)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
1047)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
2459)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
2512)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
android.app.ActivityThread.access$2200(ActivityThread.java:119)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
android.os.Handler.dispatchMessage(Handler.java:99)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
android.os.Looper.loop(Looper.java:123)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
android.app.ActivityThread.main(ActivityThread.java:4363)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
java.lang.reflect.Method.invokeNative(Native Method)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
java.lang.reflect.Method.invoke(Method.java:521)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
dalvik.system.NativeStart.main(Native Method)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Victoria Busse
2010-07-20 12:39:57 UTC
Permalink
I was trying to use sendIntent.putExtra(Intent.EXTRA_STREAM,
Uri.fromFile(new File(uri)));

but then I get an eclipse error saying that I should change String vuri =
Uri.parse(videocursor.getString(0)); into an uri because of a type mismatch,
when I do that eclipse says I should change it back into a String...
Post by DanH
Well, I can tell you it's looking for the file /sdcard/Video0006.mp4
and not finding it.
Post by kivy
Hi everyone,
when I try to attach a file to an email, I get a
java.io.FileNotFoundException: No content provider logcat output. If
anyone could tell me what I am doing wrong or what I should do
instead, that would be great.Thank you.
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
sendIntent.setType("video/3gp");
sendIntent.setType("video/mp4");
startActivity(sendIntent);
20 09:15:58.364: ERROR/Mms/media(168): IOException caught while
opening or reading stream
java.io.FileNotFoundException: No content provider: /sdcard/
Video0006.mp4
07-20 09:15:58.364: ERROR/Mms/media(168): at
507)
07-20 09:15:58.364: ERROR/Mms/media(168): at
345)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.MediaModel.initMediaSize(MediaModel.java:268)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.MediaModel.<init>(MediaModel.java:76)
07-20 09:15:58.364: ERROR/Mms/media(168): at
40)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.VideoModel.<init>(VideoModel.java:55)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.VideoModel.<init>(VideoModel.java:48)
07-20 09:15:58.364: ERROR/Mms/media(168): at
434)
07-20 09:15:58.364: ERROR/Mms/media(168): at
343)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2472)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2544)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2521)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1703)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1633)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1047)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2459)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2512)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread.access$2200(ActivityThread.java:119)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.os.Looper.loop(Looper.java:123)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread.main(ActivityThread.java:4363)
07-20 09:15:58.364: ERROR/Mms/media(168): at
java.lang.reflect.Method.invokeNative(Native Method)
07-20 09:15:58.364: ERROR/Mms/media(168): at
java.lang.reflect.Method.invoke(Method.java:521)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-20 09:15:58.364: ERROR/Mms/media(168): at
dalvik.system.NativeStart.main(Native Method)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
DanH
2010-07-20 15:56:59 UTC
Permalink
Uri.parse() returns a Uri. I'm guessing you misinterpreted the second
message.
Post by Victoria Busse
I was trying to use sendIntent.putExtra(Intent.EXTRA_STREAM,
Uri.fromFile(new File(uri)));
but then I get an eclipse error saying that I should change String vuri =
Uri.parse(videocursor.getString(0)); into an uri because of a type mismatch,
when I do that eclipse says I should change it back into a String...
Post by DanH
Well, I can tell you it's looking for the file /sdcard/Video0006.mp4
and not finding it.
Post by kivy
Hi everyone,
when I try to attach a file to an email, I get a
java.io.FileNotFoundException: No content provider logcat output. If
anyone could tell me what I am doing wrong or what I should do
instead, that would be great.Thank you.
Intent sendIntent = new Intent(Intent.ACTION_SEND);
                sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
                sendIntent.setType("video/3gp");
                sendIntent.setType("video/mp4");
                startActivity(sendIntent);
20 09:15:58.364: ERROR/Mms/media(168): IOException caught while
opening or reading stream
java.io.FileNotFoundException: No content provider: /sdcard/
Video0006.mp4
07-20 09:15:58.364: ERROR/Mms/media(168):     at
507)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
345)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
com.android.mms.model.MediaModel.initMediaSize(MediaModel.java:268)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
com.android.mms.model.MediaModel.<init>(MediaModel.java:76)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
40)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
com.android.mms.model.VideoModel.<init>(VideoModel.java:55)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
com.android.mms.model.VideoModel.<init>(VideoModel.java:48)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
434)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
343)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
2472)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
2544)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
2521)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
1703)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
1633)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
1047)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
2459)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
2512)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
android.app.ActivityThread.access$2200(ActivityThread.java:119)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
android.os.Handler.dispatchMessage(Handler.java:99)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
android.os.Looper.loop(Looper.java:123)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
android.app.ActivityThread.main(ActivityThread.java:4363)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
java.lang.reflect.Method.invokeNative(Native Method)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
java.lang.reflect.Method.invoke(Method.java:521)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-20 09:15:58.364: ERROR/Mms/media(168):     at
dalvik.system.NativeStart.main(Native Method)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Victoria Busse
2010-07-20 21:32:10 UTC
Permalink
Okay, I really have no idea what I have to do:
I tried to create the file:// but nothing I try seems to work... :(((

Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new
File(videocursor.getString(0))));
sendIntent.setType("video/3gp");
sendIntent.setType("video/mp4");
startActivity(Intent.createChooser(sendIntent, "Email:"));
Post by DanH
Uri.parse() returns a Uri. I'm guessing you misinterpreted the second
message.
Post by Victoria Busse
I was trying to use sendIntent.putExtra(Intent.EXTRA_STREAM,
Uri.fromFile(new File(uri)));
but then I get an eclipse error saying that I should change String vuri =
Uri.parse(videocursor.getString(0)); into an uri because of a type
mismatch,
Post by Victoria Busse
when I do that eclipse says I should change it back into a String...
Post by DanH
Well, I can tell you it's looking for the file /sdcard/Video0006.mp4
and not finding it.
Post by kivy
Hi everyone,
when I try to attach a file to an email, I get a
java.io.FileNotFoundException: No content provider logcat output. If
anyone could tell me what I am doing wrong or what I should do
instead, that would be great.Thank you.
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
sendIntent.setType("video/3gp");
sendIntent.setType("video/mp4");
startActivity(sendIntent);
20 09:15:58.364: ERROR/Mms/media(168): IOException caught while
opening or reading stream
java.io.FileNotFoundException: No content provider: /sdcard/
Video0006.mp4
07-20 09:15:58.364: ERROR/Mms/media(168): at
507)
07-20 09:15:58.364: ERROR/Mms/media(168): at
345)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.MediaModel.initMediaSize(MediaModel.java:268)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.MediaModel.<init>(MediaModel.java:76)
07-20 09:15:58.364: ERROR/Mms/media(168): at
40)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.VideoModel.<init>(VideoModel.java:55)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.VideoModel.<init>(VideoModel.java:48)
07-20 09:15:58.364: ERROR/Mms/media(168): at
434)
07-20 09:15:58.364: ERROR/Mms/media(168): at
343)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2472)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2544)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2521)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1703)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1633)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1047)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2459)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2512)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread.access$2200(ActivityThread.java:119)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.os.Looper.loop(Looper.java:123)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread.main(ActivityThread.java:4363)
07-20 09:15:58.364: ERROR/Mms/media(168): at
java.lang.reflect.Method.invokeNative(Native Method)
07-20 09:15:58.364: ERROR/Mms/media(168): at
java.lang.reflect.Method.invoke(Method.java:521)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-20 09:15:58.364: ERROR/Mms/media(168): at
dalvik.system.NativeStart.main(Native Method)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Victoria Busse
2010-07-21 08:22:53 UTC
Permalink
Hi

after having (apparently) solved the Content Provider Problem (at least I
don't get the error message anymore)... I still cannot attach the videos to
the email as the email app tells me "Sorry, video cannot be attached"...and
I really don't know what I should do anymore. I hope someone can help me out
here. Thank you in advance!

Here is what I have done:

*The onClick event:*

vGrid.setOnItemClickListener(new OnItemClickListener() {


// click on item and open options menu

public void onItemClick(AdapterView<?> parent, View v,
int position, long id) {


//get uri of selected/clicked video


String [] proj={MediaStore.Video.Media.DATA};

videocursor = managedQuery(
MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, null,null,null);

videocursor.moveToPosition(position);


Uri uri = Uri.parse(videocursor.getString(0));

Log.d("EditGalleryView", "pos: "+position+", uri: "+uri);

// print the filename

Toast.makeText(EditGalleryView.this, "You just
selected " +uri, Toast.LENGTH_SHORT).show();

openOptionsMenu(); //Opens Options Menu by clicking a video

}

});


*The onOptionsItemSelected event:*

public boolean onOptionsItemSelected (MenuItem item){

...

else if (item.getItemId() == R.id.menu_email)

{

//TODO open YouTube

/*new AlertDialog.Builder(this)

.setTitle("No Service")
.setMessage("Sorry, Email is not supported yet!")
.setNeutralButton("Close", new
DialogInterface.OnClickListener() {

public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}}).show();*/

//Uri uri = Uri.parse("file://" + videocursor.getString(0));

Uri uri = Uri.fromFile(new File(videocursor.getString(0)));

Intent sendIntent = new Intent(Intent.ACTION_SEND);

sendIntent.putExtra(Intent.EXTRA_STREAM, uri);

sendIntent.setType("video/3gp");

sendIntent.setType("video/mp4");

startActivity(sendIntent);

Log.d("EditGallerView path", uri.toString());

return true;

}
...
return super.onContextItemSelected(item);
}

*The logcat output:*

7-21 01:15:17.663: INFO/ActivityManager(53): Starting activity: Intent
{ act=android.intent.action.SEND typ=video/mp4
cmp=com.android.mms/.ui.ComposeMessageActivity (has extras) }
07-21 01:15:17.693: DEBUG/EditGallerView path(234): file:///sdcard/Video0006.mp4
07-21 01:15:17.853: INFO/NotificationService(53): enqueueToast
pkg=com.android.mms
callback=android.app.ITransientNotification$Stub$***@43d56a70
duration=0
07-21 01:15:18.032: DEBUG/dalvikvm(103): GREF has increased to 201
07-21 01:15:18.333: WARN/InputManagerService(53): Starting input on
non-focused client
com.android.internal.view.IInputMethodClient$Stub$***@43cc1e98
(uid=10024 pid=234)
07-21 01:15:18.433: INFO/ActivityManager(53): Displayed activity
com.android.mms/.ui.ComposeMessageActivity: 726 ms (total 726 ms)
07-21 01:15:23.543: DEBUG/dalvikvm(159): GC freed 306 objects / 12024
bytes in 89ms
07-21 01:15:28.553: DEBUG/dalvikvm(234): GC freed 1255 objects / 72056
bytes in 102


On Tue, Jul 20, 2010 at 10:32 PM, Victoria Busse <
Post by Victoria Busse
I tried to create the file:// but nothing I try seems to work... :(((
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new
File(videocursor.getString(0))));
sendIntent.setType("video/3gp");
sendIntent.setType("video/mp4");
startActivity(Intent.createChooser(sendIntent, "Email:"));
Post by DanH
Uri.parse() returns a Uri. I'm guessing you misinterpreted the second
message.
Post by Victoria Busse
I was trying to use sendIntent.putExtra(Intent.EXTRA_STREAM,
Uri.fromFile(new File(uri)));
but then I get an eclipse error saying that I should change String vuri
=
Post by Victoria Busse
Uri.parse(videocursor.getString(0)); into an uri because of a type
mismatch,
Post by Victoria Busse
when I do that eclipse says I should change it back into a String...
Post by DanH
Well, I can tell you it's looking for the file /sdcard/Video0006.mp4
and not finding it.
Post by kivy
Hi everyone,
when I try to attach a file to an email, I get a
java.io.FileNotFoundException: No content provider logcat output. If
anyone could tell me what I am doing wrong or what I should do
instead, that would be great.Thank you.
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
sendIntent.setType("video/3gp");
sendIntent.setType("video/mp4");
startActivity(sendIntent);
20 09:15:58.364: ERROR/Mms/media(168): IOException caught while
opening or reading stream
java.io.FileNotFoundException: No content provider: /sdcard/
Video0006.mp4
07-20 09:15:58.364: ERROR/Mms/media(168): at
507)
07-20 09:15:58.364: ERROR/Mms/media(168): at
345)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.MediaModel.initMediaSize(MediaModel.java:268)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.MediaModel.<init>(MediaModel.java:76)
07-20 09:15:58.364: ERROR/Mms/media(168): at
40)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.VideoModel.<init>(VideoModel.java:55)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.VideoModel.<init>(VideoModel.java:48)
07-20 09:15:58.364: ERROR/Mms/media(168): at
434)
07-20 09:15:58.364: ERROR/Mms/media(168): at
343)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2472)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2544)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2521)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1703)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1633)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1047)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2459)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2512)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread.access$2200(ActivityThread.java:119)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.os.Looper.loop(Looper.java:123)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread.main(ActivityThread.java:4363)
07-20 09:15:58.364: ERROR/Mms/media(168): at
java.lang.reflect.Method.invokeNative(Native Method)
07-20 09:15:58.364: ERROR/Mms/media(168): at
java.lang.reflect.Method.invoke(Method.java:521)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-20 09:15:58.364: ERROR/Mms/media(168): at
dalvik.system.NativeStart.main(Native Method)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Victoria Busse
2010-07-21 08:37:51 UTC
Permalink
And here is the logcat output:

7-21 01:15:17.663: INFO/ActivityManager(53): Starting activity: Intent
{ act=android.intent.action.SEND typ=video/mp4
cmp=com.android.mms/.ui.ComposeMessageActivity (has extras) }
07-21 01:15:17.693: DEBUG/EditGallerView path(234): file:///sdcard/Video0006.mp4
07-21 01:15:17.853: INFO/NotificationService(53): enqueueToast
pkg=com.android.mms
callback=android.app.ITransientNotification$Stub$***@43d56a70
duration=0
07-21 01:15:18.032: DEBUG/dalvikvm(103): GREF has increased to 201
07-21 01:15:18.333: WARN/InputManagerService(53): Starting input on
non-focused client
com.android.internal.view.IInputMethodClient$Stub$***@43cc1e98
(uid=10024 pid=234)
07-21 01:15:18.433: INFO/ActivityManager(53): Displayed activity
com.android.mms/.ui.ComposeMessageActivity: 726 ms (total 726 ms)
07-21 01:15:23.543: DEBUG/dalvikvm(159): GC freed 306 objects / 12024
bytes in 89ms
07-21 01:15:28.553: DEBUG/dalvikvm(234): GC freed 1255 objects / 72056
bytes in 102
Post by Victoria Busse
Hi
after having (apparently) solved the Content Provider Problem (at least I
don't get the error message anymore)... I still cannot attach the videos to
the email as the email app tells me "Sorry, video cannot be attached"...and
I really don't know what I should do anymore. I hope someone can help me out
here. Thank you in advance!
*The onClick event:*
vGrid.setOnItemClickListener(new OnItemClickListener() {
// click on item and open options menu
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
//get uri of selected/clicked video
String [] proj={MediaStore.Video.Media.DATA};
videocursor = managedQuery( MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, null,null,null);
videocursor.moveToPosition(position);
Uri uri = Uri.parse(videocursor.getString(0));
Log.d("EditGalleryView", "pos: "+position+", uri: "+uri);
// print the filename
Toast.makeText(EditGalleryView.this, "You just selected " +uri, Toast.LENGTH_SHORT).show();
openOptionsMenu(); //Opens Options Menu by clicking a video
}
});
*The onOptionsItemSelected event:*
public boolean onOptionsItemSelected (MenuItem item){
...
else if (item.getItemId() == R.id.menu_email)
{
//TODO open YouTube
/*new AlertDialog.Builder(this)
.setTitle("No Service")
.setMessage("Sorry, Email is not supported yet!")
.setNeutralButton("Close", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}}).show();*/
//Uri uri = Uri.parse("file://" + videocursor.getString(0));
Uri uri = Uri.fromFile(new File(videocursor.getString(0)));
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
sendIntent.setType("video/3gp");
sendIntent.setType("video/mp4");
startActivity(sendIntent);
Log.d("EditGallerView path", uri.toString());
return true;
}
...
return super.onContextItemSelected(item);
}
*The logcat output:*
7-21 01:15:17.663: INFO/ActivityManager(53): Starting activity: Intent { act=android.intent.action.SEND typ=video/mp4 cmp=com.android.mms/.ui.ComposeMessageActivity (has extras) }
07-21 01:15:17.693: DEBUG/EditGallerView path(234): file:///sdcard/Video0006.mp4
07-21 01:15:18.032: DEBUG/dalvikvm(103): GREF has increased to 201
07-21 01:15:18.433: INFO/ActivityManager(53): Displayed activity com.android.mms/.ui.ComposeMessageActivity: 726 ms (total 726 ms)
07-21 01:15:23.543: DEBUG/dalvikvm(159): GC freed 306 objects / 12024 bytes in 89ms
07-21 01:15:28.553: DEBUG/dalvikvm(234): GC freed 1255 objects / 72056 bytes in 102
On Tue, Jul 20, 2010 at 10:32 PM, Victoria Busse <
Post by Victoria Busse
I tried to create the file:// but nothing I try seems to work... :(((
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new
File(videocursor.getString(0))));
sendIntent.setType("video/3gp");
sendIntent.setType("video/mp4");
startActivity(Intent.createChooser(sendIntent, "Email:"));
Post by DanH
Uri.parse() returns a Uri. I'm guessing you misinterpreted the second
message.
Post by Victoria Busse
I was trying to use sendIntent.putExtra(Intent.EXTRA_STREAM,
Uri.fromFile(new File(uri)));
but then I get an eclipse error saying that I should change String vuri
=
Post by Victoria Busse
Uri.parse(videocursor.getString(0)); into an uri because of a type
mismatch,
Post by Victoria Busse
when I do that eclipse says I should change it back into a String...
Post by DanH
Well, I can tell you it's looking for the file /sdcard/Video0006.mp4
and not finding it.
Post by kivy
Hi everyone,
when I try to attach a file to an email, I get a
java.io.FileNotFoundException: No content provider logcat output.
If
Post by Victoria Busse
Post by DanH
Post by kivy
anyone could tell me what I am doing wrong or what I should do
instead, that would be great.Thank you.
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
sendIntent.setType("video/3gp");
sendIntent.setType("video/mp4");
startActivity(sendIntent);
20 09:15:58.364: ERROR/Mms/media(168): IOException caught while
opening or reading stream
java.io.FileNotFoundException: No content provider: /sdcard/
Video0006.mp4
07-20 09:15:58.364: ERROR/Mms/media(168): at
507)
07-20 09:15:58.364: ERROR/Mms/media(168): at
345)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.MediaModel.initMediaSize(MediaModel.java:268)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.MediaModel.<init>(MediaModel.java:76)
07-20 09:15:58.364: ERROR/Mms/media(168): at
40)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.VideoModel.<init>(VideoModel.java:55)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.VideoModel.<init>(VideoModel.java:48)
07-20 09:15:58.364: ERROR/Mms/media(168): at
434)
07-20 09:15:58.364: ERROR/Mms/media(168): at
343)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2472)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2544)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2521)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1703)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1633)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1047)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2459)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2512)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread.access$2200(ActivityThread.java:119)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
Post by Victoria Busse
Post by DanH
Post by kivy
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.os.Looper.loop(Looper.java:123)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread.main(ActivityThread.java:4363)
07-20 09:15:58.364: ERROR/Mms/media(168): at
java.lang.reflect.Method.invokeNative(Native Method)
07-20 09:15:58.364: ERROR/Mms/media(168): at
java.lang.reflect.Method.invoke(Method.java:521)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-20 09:15:58.364: ERROR/Mms/media(168): at
dalvik.system.NativeStart.main(Native Method)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Kostya Vasilyev
2010-07-21 18:42:30 UTC
Permalink
Victoria,

A short in the dark, really, but hey -

"Sorry, video cannot be attached" sounds like an the email application
recognizes the attachment, and its type (video) and simply doesn't want
for whatever reason to send a message with video attachments.

Maybe try a different email app? If you were using

<at this point I actually read the log file below>

I believe your intent launches an MMS message, not email. I'm sure there
are limitations on the type and size of video files that can be sent
over MMS (there are for pictures, even).

Change the way you build the intent so it does what you intend (no pun
intended) - launches an email message, not MMS message.

-- Kostya
|7-21 01:15:17.663: INFO/ActivityManager(53): Starting activity: Intent { act=android.intent.action.SEND typ=video/mp4 cmp=com.android.mms/.ui.ComposeMessageActivity (has extras) }
07-21 01:15:17.693: DEBUG/EditGallerView path(234): file:///sdcard/Video0006.mp4
07-21 01:15:18.032: DEBUG/dalvikvm(103): GREF has increased to201
07-21 01:15:18.433: INFO/ActivityManager(53): Displayed activity com.android.mms/.ui.ComposeMessageActivity: 726 ms(total726 ms)
07-21 01:15:23.543: DEBUG/dalvikvm(159): GC freed306 objects/ 12024 bytesin 89ms
07-21 01:15:28.553: DEBUG/dalvikvm(234): GC freed1255 objects/ 72056 bytesin 102|
On Wed, Jul 21, 2010 at 9:22 AM, Victoria Busse
Hi
after having (apparently) solved the Content Provider Problem (at
least I don't get the error message anymore)... I still cannot
attach the videos to the email as the email app tells me "Sorry,
video cannot be attached"...and I really don't know what I should
do anymore. I hope someone can help me out here. Thank you in advance!
*The onClick event:*
|vGrid.setOnItemClickListener(new OnItemClickListener() {|
// click on item and open options menu public void
onItemClick(AdapterView<?> parent, View v, int position, long id) {
//get uri of selected/clicked video
String [] proj={MediaStore.Video.Media.DATA};
videocursor = managedQuery(
MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj,
null,null,null);
videocursor.moveToPosition(position);
Uri uri= Uri.parse(videocursor.getString(0));
Log.d("EditGalleryView", "pos:"+position+", uri:"+uri);
// print the filename
Toast.makeText(EditGalleryView.this, "You just selected" +uri, Toast.LENGTH_SHORT).show();
openOptionsMenu(); //Opens Options Menu by clicking a video
|
| }
});|
*The onOptionsItemSelected event:*
| public boolean onOptionsItemSelected(MenuItem item){
...
else if (item.getItemId() == R.id.menu_email)
{
//TODO open YouTube
/*new AlertDialog.Builder(this)
.setTitle("No Service")
.setMessage("Sorry, Email is not supported yet!")
.setNeutralButton("Close", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}}).show();*/
//Uri uri = Uri.parse("file://" + videocursor.getString(0));
Uri uri= Uri.fromFile(new File(videocursor.getString(0)));
Intent sendIntent= new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
sendIntent.setType("video/3gp");
sendIntent.setType("video/mp4");
startActivity(sendIntent);
Log.d("EditGallerView path", uri.toString());
return true;
}
...
return super.onContextItemSelected(item);
}|
*The logcat output:*
|
|7-21 01:15:17.663: INFO/ActivityManager(53): Starting activity: Intent { act=android.intent.action.SEND typ=video/mp4 cmp=com.android.mms/.ui.ComposeMessageActivity (has extras) }
07-21 01:15:17.693: DEBUG/EditGallerView path(234): file:///sdcard/Video0006.mp4
07-21 01:15:18.032: DEBUG/dalvikvm(103): GREF has increased to201
07-21 01:15:18.433: INFO/ActivityManager(53): Displayed activity com.android.mms/.ui.ComposeMessageActivity: 726 ms(total726 ms)
07-21 01:15:23.543: DEBUG/dalvikvm(159): GC freed306 objects/ 12024 bytesin 89ms
07-21 01:15:28.553: DEBUG/dalvikvm(234): GC freed1255 objects/ 72056 bytesin 102|
||
On Tue, Jul 20, 2010 at 10:32 PM, Victoria Busse
I tried to create the file:// but nothing I try seems to work... :(((
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new
File(videocursor.getString(0))));
sendIntent.setType("video/3gp");
sendIntent.setType("video/mp4");
startActivity(Intent.createChooser(sendIntent, "Email:"));
Uri.parse() returns a Uri. I'm guessing you
misinterpreted the second
message.
On Jul 20, 7:39 am, Victoria Busse
Post by Victoria Busse
I was trying to use sendIntent.putExtra(Intent.EXTRA_STREAM,
Uri.fromFile(new File(uri)));
but then I get an eclipse error saying that I should
change String vuri =
Post by Victoria Busse
Uri.parse(videocursor.getString(0)); into an uri because
of a type mismatch,
Post by Victoria Busse
when I do that eclipse says I should change it back into
a String...
Post by Victoria Busse
Post by DanH
Well, I can tell you it's looking for the file
/sdcard/Video0006.mp4
Post by Victoria Busse
Post by DanH
and not finding it.
Post by kivy
Hi everyone,
when I try to attach a file to an email, I get a
java.io.FileNotFoundException: No content provider
logcat output. If
Post by Victoria Busse
Post by DanH
Post by kivy
anyone could tell me what I am doing wrong or what I
should do
Post by Victoria Busse
Post by DanH
Post by kivy
instead, that would be great.Thank you.
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
Post by Victoria Busse
Post by DanH
Post by kivy
sendIntent.setType("video/3gp");
sendIntent.setType("video/mp4");
startActivity(sendIntent);
20 09:15:58.364: ERROR/Mms/media(168): IOException
caught while
Post by Victoria Busse
Post by DanH
Post by kivy
opening or reading stream
/sdcard/
Post by Victoria Busse
Post by DanH
Post by kivy
Video0006.mp4
07-20 09:15:58.364: ERROR/Mms/media(168): at
507)
07-20 09:15:58.364: ERROR/Mms/media(168): at
345)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.MediaModel.initMediaSize(MediaModel.java:268)
Post by Victoria Busse
Post by DanH
Post by kivy
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.MediaModel.<init>(MediaModel.java:76)
Post by Victoria Busse
Post by DanH
Post by kivy
07-20 09:15:58.364: ERROR/Mms/media(168): at
40)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.VideoModel.<init>(VideoModel.java:55)
Post by Victoria Busse
Post by DanH
Post by kivy
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.VideoModel.<init>(VideoModel.java:48)
Post by Victoria Busse
Post by DanH
Post by kivy
07-20 09:15:58.364: ERROR/Mms/media(168): at
434)
07-20 09:15:58.364: ERROR/Mms/media(168): at
343)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2472)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2544)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2521)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1703)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1633)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1047)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2459)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2512)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread.access$2200(ActivityThread.java:119)
Post by Victoria Busse
Post by DanH
Post by kivy
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
Post by Victoria Busse
Post by DanH
Post by kivy
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.os.Looper.loop(Looper.java:123)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread.main(ActivityThread.java:4363)
Post by Victoria Busse
Post by DanH
Post by kivy
07-20 09:15:58.364: ERROR/Mms/media(168): at
java.lang.reflect.Method.invokeNative(Native Method)
07-20 09:15:58.364: ERROR/Mms/media(168): at
java.lang.reflect.Method.invoke(Method.java:521)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Post by Victoria Busse
Post by DanH
Post by kivy
07-20 09:15:58.364: ERROR/Mms/media(168): at
dalvik.system.NativeStart.main(Native Method)
--
You received this message because you are subscribed
to the Google
Post by Victoria Busse
Post by DanH
Groups "Android Developers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Victoria Busse
2010-07-21 21:57:07 UTC
Permalink
OMG, this was exactly the problem, I had to create a chooser and set up an
email account (!!!) and now when I click email I can now choose between MMS
and Email, THANK YOU SO SO MUCH!!!
Post by Kostya Vasilyev
Victoria,
A short in the dark, really, but hey -
"Sorry, video cannot be attached" sounds like an the email application
recognizes the attachment, and its type (video) and simply doesn't want for
whatever reason to send a message with video attachments.
Maybe try a different email app? If you were using
<at this point I actually read the log file below>
I believe your intent launches an MMS message, not email. I'm sure there
are limitations on the type and size of video files that can be sent over
MMS (there are for pictures, even).
Change the way you build the intent so it does what you intend (no pun
intended) - launches an email message, not MMS message.
-- Kostya
7-21 01:15:17.663: INFO/ActivityManager(53): Starting activity: Intent { act=android.intent.action.SEND typ=video/mp4 cmp=com.android.mms/.ui.ComposeMessageActivity (has extras) }
07-21 01:15:17.693: DEBUG/EditGallerView path(234): file:///sdcard/Video0006.mp4
07-21 01:15:18.032: DEBUG/dalvikvm(103): GREF has increased to 201
07-21 01:15:18.433: INFO/ActivityManager(53): Displayed activity com.android.mms/.ui.ComposeMessageActivity: 726 ms (total 726 ms)
07-21 01:15:23.543: DEBUG/dalvikvm(159): GC freed 306 objects / 12024 bytes in 89ms
07-21 01:15:28.553: DEBUG/dalvikvm(234): GC freed 1255 objects / 72056 bytes in 102
On Wed, Jul 21, 2010 at 9:22 AM, Victoria Busse <
Post by Victoria Busse
Hi
after having (apparently) solved the Content Provider Problem (at least
I don't get the error message anymore)... I still cannot attach the videos
to the email as the email app tells me "Sorry, video cannot be
attached"...and I really don't know what I should do anymore. I hope someone
can help me out here. Thank you in advance!
*The onClick event:*
vGrid.setOnItemClickListener(new OnItemClickListener() {
// click on item and open options menu
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
//get uri of selected/clicked video
String [] proj={MediaStore.Video.Media.DATA};
videocursor = managedQuery( MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, null,null,null);
videocursor.moveToPosition(position);
Uri uri = Uri.parse(videocursor.getString(0));
Log.d("EditGalleryView", "pos: "+position+", uri: "+uri);
// print the filename
Toast.makeText(EditGalleryView.this, "You just selected " +uri, Toast.LENGTH_SHORT).show();
openOptionsMenu(); //Opens Options Menu by clicking a video
}
});
*The onOptionsItemSelected event:*
public boolean onOptionsItemSelected (MenuItem item){
...
else if (item.getItemId() == R.id.menu_email)
{
//TODO open YouTube
/*new AlertDialog.Builder(this)
.setTitle("No Service")
.setMessage("Sorry, Email is not supported yet!")
.setNeutralButton("Close", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}}).show();*/
//Uri uri = Uri.parse("file://" + videocursor.getString(0));
Uri uri = Uri.fromFile(new File(videocursor.getString(0)));
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
sendIntent.setType("video/3gp");
sendIntent.setType("video/mp4");
startActivity(sendIntent);
Log.d("EditGallerView path", uri.toString());
return true;
}
...
return super.onContextItemSelected(item);
}
*The logcat output:*
7-21 01:15:17.663: INFO/ActivityManager(53): Starting activity: Intent { act=android.intent.action.SEND typ=video/mp4 cmp=com.android.mms/.ui.ComposeMessageActivity (has extras) }
07-21 01:15:17.693: DEBUG/EditGallerView path(234): file:///sdcard/Video0006.mp4
07-21 01:15:18.032: DEBUG/dalvikvm(103): GREF has increased to 201
07-21 01:15:18.433: INFO/ActivityManager(53): Displayed activity com.android.mms/.ui.ComposeMessageActivity: 726 ms (total 726 ms)
07-21 01:15:23.543: DEBUG/dalvikvm(159): GC freed 306 objects / 12024 bytes in 89ms
07-21 01:15:28.553: DEBUG/dalvikvm(234): GC freed 1255 objects / 72056 bytes in 102
On Tue, Jul 20, 2010 at 10:32 PM, Victoria Busse <
Post by Victoria Busse
I tried to create the file:// but nothing I try seems to work... :(((
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new
File(videocursor.getString(0))));
sendIntent.setType("video/3gp");
sendIntent.setType("video/mp4");
startActivity(Intent.createChooser(sendIntent, "Email:"));
Post by DanH
Uri.parse() returns a Uri. I'm guessing you misinterpreted the second
message.
Post by Victoria Busse
I was trying to use sendIntent.putExtra(Intent.EXTRA_STREAM,
Uri.fromFile(new File(uri)));
but then I get an eclipse error saying that I should change String
vuri =
Post by Victoria Busse
Uri.parse(videocursor.getString(0)); into an uri because of a type
mismatch,
Post by Victoria Busse
when I do that eclipse says I should change it back into a String...
Post by DanH
Well, I can tell you it's looking for the file /sdcard/Video0006.mp4
and not finding it.
Post by kivy
Hi everyone,
when I try to attach a file to an email, I get a
java.io.FileNotFoundException: No content provider logcat output.
If
Post by Victoria Busse
Post by DanH
Post by kivy
anyone could tell me what I am doing wrong or what I should do
instead, that would be great.Thank you.
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
sendIntent.setType("video/3gp");
sendIntent.setType("video/mp4");
startActivity(sendIntent);
20 09:15:58.364: ERROR/Mms/media(168): IOException caught while
opening or reading stream
java.io.FileNotFoundException: No content provider: /sdcard/
Video0006.mp4
07-20 09:15:58.364: ERROR/Mms/media(168): at
507)
07-20 09:15:58.364: ERROR/Mms/media(168): at
345)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.MediaModel.initMediaSize(MediaModel.java:268)
Post by Victoria Busse
Post by DanH
Post by kivy
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.MediaModel.<init>(MediaModel.java:76)
07-20 09:15:58.364: ERROR/Mms/media(168): at
40)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.VideoModel.<init>(VideoModel.java:55)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.mms.model.VideoModel.<init>(VideoModel.java:48)
07-20 09:15:58.364: ERROR/Mms/media(168): at
434)
07-20 09:15:58.364: ERROR/Mms/media(168): at
343)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2472)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2544)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2521)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1703)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1633)
07-20 09:15:58.364: ERROR/Mms/media(168): at
1047)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2459)
07-20 09:15:58.364: ERROR/Mms/media(168): at
2512)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread.access$2200(ActivityThread.java:119)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
Post by Victoria Busse
Post by DanH
Post by kivy
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.os.Looper.loop(Looper.java:123)
07-20 09:15:58.364: ERROR/Mms/media(168): at
android.app.ActivityThread.main(ActivityThread.java:4363)
07-20 09:15:58.364: ERROR/Mms/media(168): at
java.lang.reflect.Method.invokeNative(Native Method)
07-20 09:15:58.364: ERROR/Mms/media(168): at
java.lang.reflect.Method.invoke(Method.java:521)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-20 09:15:58.364: ERROR/Mms/media(168): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-20 09:15:58.364: ERROR/Mms/media(168): at
dalvik.system.NativeStart.main(Native Method)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Loading...