Wie zum teilen von Text und Bild auf Facebook mit Absicht

Wie zum teilen von Text und Bild auf Facebook, ich Schreibe eine Kirche, in welcher Anwendung ich möchte der Benutzer zum teilen von text und Bild mit URL.

Ich bin in der Lage, share-online app-link, aber nicht in der Lage zu teilen, text & Bild, wo ich vermisst werde ?

mein code sieht wie folgt aus:

Button btnFbSharing = (Button) findViewById(R.id.fbSharing);
        btnFbSharing.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {
                //TODO Auto-generated method stub

                 Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
                 shareIntent.setType("text/plain");
                 shareIntent.putExtra(android.content.Intent.EXTRA_TITLE, "Church Application");
                 shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "https://play.google.com/store/apps/details?id=com.facebook.katana");
                 shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "A new world begin");

                 shareIntent.putExtra(android.content.Intent.EXTRA_STREAM, R.drawable.ic_launcher);
                 PackageManager pm = getApplicationContext().getPackageManager();
                 List<ResolveInfo> activityList = pm.queryIntentActivities(shareIntent, 0);
                 for (final ResolveInfo app : activityList) {
                    if ((app.activityInfo.name).contains("facebook")) {
                        final ActivityInfo activity = app.activityInfo;
                        final ComponentName name = new ComponentName(
                                    activity.applicationInfo.packageName,
                                    activity.name);
                        shareIntent.addCategory(Intent.CATEGORY_LAUNCHER);
                        shareIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
                                            | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
                        shareIntent.setComponent(name);
                        startActivity(shareIntent);
                       }
                 }                  
            }
        });

InformationsquelleAutor Sophie | 2014-05-08
Schreibe einen Kommentar