意図

2012-03-07 14 views
1

このバグは、今年のために報告されていないと何が私がここに述べた回避策を試してみてくださいまだ意図

http://forum.developers.facebook.net/viewtopic.php?id=93900

http://bugs.developers.facebook.net/show_bug.cgi?id=16728

固定、それはしていませんいずれかの作業。私は

How to share photo with CAPTION via Android share intent on Facebook?

真の回避策は、その後何ですかFacebookのバージョン1.8.3を使用していますか?

答えて

0

アンドロイドのアプリケーションからFacebookやTwitterで何かを共有したい場合は、Android SDKとTwitter SDKにアプリケーションを統合する必要があります。あなたはこれらを統合bethoutこれらを共有したい場合、あなたはあなたのFacebookやTwitterのAPKは、コードの上に動作するようにあなたのデバイス/エミュレータにインストールする必要があることを下記の...

public class MainActivity extends Activity { 

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

    // listeners of our two buttons 
    View.OnClickListener handler = new View.OnClickListener() { 
     public void onClick(View v) { 
      switch (v.getId()) { 

      case R.id.buttonShareTextUrl: 
       shareTextUrl(); 
       break; 

      case R.id.buttonShareImage: 
       shareImage(); 
       break; 
      } 
     } 
    }; 

    // our buttons 
    findViewById(R.id.buttonShareTextUrl).setOnClickListener(handler); 
    findViewById(R.id.buttonShareImage).setOnClickListener(handler); 

} 

/* 
* Method to share either text or URL. 
*/ 
private void shareTextUrl() { 
    Intent share = new Intent(android.content.Intent.ACTION_SEND); 
    share.setType("text/plain"); 
    share.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); 

    // Add data to the intent, the receiving app will decide 
    // what to do with it. 
    share.putExtra(Intent.EXTRA_SUBJECT, "Title Of The Post"); 
    share.putExtra(Intent.EXTRA_TEXT, "http://two55am.com"); 

    startActivity(Intent.createChooser(share, "Share link!")); 
}  

/* 
* Method to share any image. 
*/ 
private void shareImage() { 
    Intent share = new Intent(Intent.ACTION_SEND); 

    // If you want to share a png image only, you can do: 
    // setType("image/png"); OR for jpeg: setType("image/jpeg"); 
    share.setType("image/*"); 

    // Make sure you put example png image named myImage.png in your 
    // directory 
    String imagePath = Environment.getExternalStorageDirectory() 
      + "/twitter.png"; 

    File imageFileToShare = new File(imagePath); 

    Uri uri = Uri.fromFile(imageFileToShare); 
    share.putExtra(Intent.EXTRA_STREAM, uri); 

    startActivity(Intent.createChooser(share, "Share Image!")); 
} 

} 

ノートのような意図を送信するだけでこれを行うことができます。

+0

FacebookはEXTRA_SUBJECTを解析しません。 – user1