2016-07-22 2 views

ответ

0

Вы можете использовать ниже код

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")); 
} 

См official documentation

См this & this также

Смежные вопросы