How to add Facebook Share button in Android Application

后端 未结 1 1428
清酒与你
清酒与你 2021-02-04 14:35

I am beginner in android.I want to add FacebookShare button in my android application.I create the app in 2.2 .please help me I use this code

Intent emailIntent          


        
相关标签:
1条回答
  • 2021-02-04 14:45
      Intent shareIntent = new Intent(Intent.ACTION_SEND);
      shareIntent.setType("text/plain");
      shareIntent.putExtra(Intent.EXTRA_TEXT, "URLyouWantToShare");
      startActivity(Intent.createChooser(shareIntent, "Share..."));
    

    Use the ACTION_SEND Intent, add the URL you want to share. User will be given a selection of apps to accept the share intent such as facebook etc.

    0 讨论(0)
提交回复
热议问题