0

まず、私のアプリの機能は記事を読むことです。ユーザーが記事を読んで、その記事を facebook などに共有したい場合、タイプからリンク/ハイパーリンクを見つけることができません。

ここに私の共有機能があります

private void shareIt() {
    Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
    sharingIntent.setType("text/plain");
    String shareBody = "Here is the share content body";
    sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject Here");
    sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
    startActivity(Intent.createChooser(sharingIntent, "Share via"));
}

私が欲しいのは、コンピューターを使用して記事を読み、共有ボタンを取得したときの共有機能です。共有メディアでは、プレーン テキストではなく記事のコンテンツとして表示されます。

では、リンクを共有できるようにコードを編集するにはどうすればよいですか?

Manifest.xml について教えてください。interfilter がどのカテゴリも追加する必要があるかわかりません。

次に、共有リストを見ました。内蔵リストは、Google、Gmail、Bluetooth、LINE、またはメッセージングの代わりに、Facebook、sina、Twitter が必要なため、私にはあまり適していません。

では、Java を介して共有リストを実装するにはどうすればよいでしょうか。

4

1 に答える 1

0

こんな感じかも

sharebtn = new Custom_ButtonField(share, shareactive, shareactive) {
            protected boolean navigationClick(int status, int time) {
                if (Config_GlobalFunction.isConnected()) {
                    String NEXT_URL = "http://www.facebook.com/connect/login_success.html";
                    String APPLICATION_ID = "153555168010272";
                    String APPLICATION_SECRET = "354f91a79c8fe5a8de9d65b55ef9aa1b";
                    String[] PERMISSIONS = Facebook.Permissions.USER_DATA_PERMISSIONS;
                    ApplicationSettings as = new ApplicationSettings(
                            NEXT_URL, APPLICATION_ID, APPLICATION_SECRET,
                            PERMISSIONS);
                    Facebook fb = Facebook.getInstance(as);
                    try {
                        User user = fb.getCurrentUser();
                        user.publishStatus(Config_GlobalFunction.sharelink
                                + newsid);
                    } catch (FacebookException e) {
                    }
                } else
                    Config_GlobalFunction.Message(
                            Config_GlobalFunction.nosharenews, 1);
                return true;
            }
        };
        add(sharebtn);

前提条件: BB facebook sdk をインポートする必要があります。

于 2012-07-25T07:13:59.120 に答える