2016-09-21 11 views
0

facebookをクリックしてコンテンツを共有するときに、アクション共有アクティビティをプログラムする方法。Androidで共有アクティビティの動作をプログラミングする方法は?

enter image description here

私はコンテンツのFacebookを作成するが、私はFacebookの共有をクリックした時を示す方法を知ってはいけません。

enter image description here

Intent sendIntent = new Intent(Intent.ACTION_SEND); 
sendIntent.setType("text/plain"); 
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Compartir"); 
sendIntent.putExtra(Intent.EXTRA_TEXT, "Descargar"); 
startActivity(sendIntent); 

private void shareFacebook(){ 

    shareDialog = new ShareDialog(this); 
    ShareLinkContent linkContent = new ShareLinkContent.Builder() 
      .setContentTitle("Hello Facebook") 
      .setContentDescription(
        "The 'Hello Facebook' sample showcases simple Facebook integration") 
     .setContentUrl(Uri.parse("http://developers.facebook.com/android")) 
      .setImageUrl(...) 
      .build(); 
    shareDialog.show(linkContent); 
} 

答えて

0

私はそれが

 Intent intent = new Intent(Intent.ACTION_SEND); 
    intent.setType("text/plain"); 
    intent.putExtra(Intent.EXTRA_TEXT, "http://developers.facebook.com/android"); 
    startActivity(Intent.createChooser(intent, "share")); 
を役に立てば幸い
関連する問題