Android and Facebook share intent

前端 未结 12 2297
闹比i
闹比i 2020-11-22 13:02

I\'m developing an Android app and am interested to know how you can update the app user\'s status from within the app using Android\'s share intents.

Having looked

12条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 13:54

        public void invokeShare(Activity activity, String quote, String credit) {
        Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
        shareIntent.setType("text/plain");
        shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, activity.getString(R.string.share_subject));
        shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Example text");    
        shareIntent.putExtra("com.facebook.platform.extra.APPLICATION_ID", activity.getString(R.string.app_id));                        
        activity.startActivity(Intent.createChooser(shareIntent, activity.getString(R.string.share_title)));
    }
    

提交回复
热议问题