adeltahir
adeltahir

Reputation: 1097

How to open Instagram Posting Screen in Android?

Is there something equivalent to instagram://camera in Android like in iOS?

Upvotes: 2

Views: 563

Answers (1)

Seko
Seko

Reputation: 730

No, as I know there are not somthing equivalent but you can post photo(or video, just change a little bit) directly to instagram posting dialog:

public void postInstagramPhoto(File photo, String message, OnPostingCompleteListener onPostingCompleteListener) {
    String instagramPackage = "com.instagram.android";
    String errorMessage = "You should install Instagram app first";
    if(isPackageInstalled(instagramPackage, getActivity())){
        Intent normalIntent = new Intent(Intent.ACTION_SEND);
        normalIntent.setType("image/*");
        normalIntent.setPackage(instagramPackage);
        File media = new File(photo.getAbsolutePath());
        Uri uri = Uri.fromFile(media);
        normalIntent.putExtra(Intent.EXTRA_STREAM, uri);
        normalIntent.putExtra(Intent.EXTRA_TEXT, message);
        getActivity().startActivity(normalIntent);
    } else {
        Toast.makeText(getActivity(), "Install Instagram first.", Toast.LENGHT_SHORT).show();
    }
}

you can check other popular methods from asne-instagram here

or maybe if you need to add more social networks check this

Upvotes: 1

Related Questions