2016-07-22 13 views

Antwort

0

Sie unter Code

String type = "video/*"; 
String filename = "/myVideo.mp4"; 
String mediaPath = Environment.getExternalStorageDirectory() + filename; 

createInstagramIntent(type, mediaPath); 

private void createInstagramIntent(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); 
    share.putExtra(Intent.EXTRA_STREAM, [URI of photo]); 
    share.putExtra(Intent.EXTRA_TEXT, [Text of caption]); 

    // Broadcast the Intent. 
    startActivity(Intent.createChooser(share, "Share to")); 
} 

Siehe official documentation

this & this Siehe auch

verwenden können