當前位置: 首頁>>代碼示例>>Java>>正文


Java FacebookDialog.MessageDialogBuilder方法代碼示例

本文整理匯總了Java中com.facebook.widget.FacebookDialog.MessageDialogBuilder方法的典型用法代碼示例。如果您正苦於以下問題:Java FacebookDialog.MessageDialogBuilder方法的具體用法?Java FacebookDialog.MessageDialogBuilder怎麽用?Java FacebookDialog.MessageDialogBuilder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.facebook.widget.FacebookDialog的用法示例。


在下文中一共展示了FacebookDialog.MessageDialogBuilder方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: shareOnFacebookMessenger

import com.facebook.widget.FacebookDialog; //導入方法依賴的package包/類
private void shareOnFacebookMessenger(String link, String picUrl) {
    // Check if the Facebook app is installed and we can present the share dialog
    FacebookDialog.MessageDialogBuilder messageDialogBuilder = new FacebookDialog.MessageDialogBuilder(this)
            .setCaption(getString(R.string.app_name))
            .setName(getString(R.string.app_name))
            .setLink(link)
            .setPicture(picUrl)
            .setDescription(mFortune.toString());

    // If the Facebook app is installed and we can present the share dialog
    if (messageDialogBuilder.canPresent()) {
        uiHelper.trackPendingDialogCall(messageDialogBuilder.build().present());
    } else {
        Toast.makeText(this, getString(R.string.facebook_messenger_not_installed_or_outdated), Toast.LENGTH_SHORT).show();
        openGooglePlayIfPossible(getString(R.string.facebook_messenger_main_package));
    }
}
 
開發者ID:BugsBunnyBR,項目名稱:Fortunes,代碼行數:18,代碼來源:MainActivity.java

示例2: onOptionsItemSelected

import com.facebook.widget.FacebookDialog; //導入方法依賴的package包/類
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    if (id == R.id.action_add) {
        startNewMessage();
        return true;
    } else if (id == R.id.invite) {
        FacebookDialog.MessageDialogBuilder builder = buildInviteFriendsDialog();

        // If the Messaging Facebook app is installed and we can present the share dialog
        if (builder.canPresent()) {
            FacebookDialog dialog = builder.build();
            dialog.present();
            return true;
        }
    } else if (id == R.id.sent_messages) {
        Intent intent = new Intent(this, ConversationActivity.class);
        intent.putExtra("sentMessages", true);
        startActivity(intent);
    } else if (id == R.id.logout) {
        ParseUser.logOut();
        ParseQuery.clearAllCachedResults();
        startActivity(new Intent(this, MainActivity.class));
        finish();
    }
    return super.onOptionsItemSelected(item);
}
 
開發者ID:cat-chat,項目名稱:cat-chat-android,代碼行數:28,代碼來源:InboxActivity.java

示例3: buildInviteFriendsDialog

import com.facebook.widget.FacebookDialog; //導入方法依賴的package包/類
private FacebookDialog.MessageDialogBuilder buildInviteFriendsDialog() {
    return new FacebookDialog.MessageDialogBuilder(this)
            .setLink("www.catchatapp.com")
            .setName(getString(R.string.fb_msg_name))
            .setCaption(getString(R.string.fb_msg_caption))
            .setDescription(getString(R.string.fb_msg_description))
            .setPicture("http://bit.ly/RPsDPY");
}
 
開發者ID:cat-chat,項目名稱:cat-chat-android,代碼行數:9,代碼來源:InboxActivity.java


注:本文中的com.facebook.widget.FacebookDialog.MessageDialogBuilder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。