Hi,

I got two problems that both seem to be connected to file://...

Problem 1: for the past days I have been trying to attach a video to
an email...but the application always tells me "Sorry, you cannot add
this video to your email"

when I try this:

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

Uri uri = Uri.fromFile(new File(videocursor.getString(0)));
I get an I/O Exception Error that the file sdcard/Video1.mp4 wasn't
found, so it seems the file:// isn't passed on at all...when test if
file:// is actually created it is always existing...

when I only try to pass on the file as a String I get a Logcat output
that android.intent.extra.STREAM expected Parcelable but value was a
java.io.File. The default value <null> was returned.

Problem 2: Another thing I tried but couldn't get working was to
delete a video from the SD card. I created the delete demand within an
AlertDialog and again file:// doesn't seem to have any effect...

AlertDialog.Builder builder = new AlertDialog.Builder(this);
               builder.setMessage("Are you sure you want to delete?")
                      .setCancelable(false)
                      .setPositiveButton("Yes", new
DialogInterface.OnClickListener() {
                          public void onClick(DialogInterface dialog,
int id) {
                               //EditGalleryView.this.finish();
                              File file = new
File(videocursor.getString(0));
                               deleted = file.delete();
                               Toast.makeText(EditGalleryView.this,
"You just deleted " +Uri.fromFile(file), Toast.LENGTH_SHORT).show();
                               Log.d("delete",
Uri.fromFile(file).toString());
                          }

                       })

I really have no idea what to do anymore...please help me Thank you

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to