Android Share - Facebook SDK - ShareActionProvider

Posted by Vlasto Benny Lava on Stack Overflow See other posts from Stack Overflow or by Vlasto Benny Lava
Published on 2012-11-14T01:13:25Z Indexed on 2012/11/25 17:04 UTC
Read the original article Hit count: 619

Filed under:
|
|

I am trying to implement sharing a simple string inside my application. Obviously everything other than Facebook works. As far as I know, now I have to use their Facebook SDK to post statuses on a wall.

However, if I do implement it using their SDK, is there a way to have it incorporated into the chooser (default or ShareActionProvider) and somehow override it and insert the Facebook SDK's implementation?

Or do I have to create a dedicated button?

//EDIT

package com.example.shareactionproviderdemo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Intent sharingIntent = new Intent(Intent.ACTION_SEND);
        sharingIntent.setType("text/plain");
        sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Test message");
        startActivity(Intent.createChooser(sharingIntent, "Share using"));
    }

}

enter image description here

© Stack Overflow or respective owner

Related posts about android

Related posts about facebook