空Facebook的FriendPickerFragment [英] Empty Facebook FriendPickerFragment

查看:121
本文介绍了空Facebook的FriendPickerFragment的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在其他片段显示FriendPickerFragment,但我得到空列表,请帮助我找不到有关大公任何信息

这是布局

 < XML版本=1.0编码=UTF-8&GT?;
< LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
机器人:layout_width =match_parent
机器人:layout_height =match_parent
机器人:方向=垂直>

<的FrameLayout
    机器人:ID =@ + ID / friend_picker_fragment
    机器人:layout_width =match_parent
    机器人:layout_height =match_parent/>

< / LinearLayout中>
 

这是片段的code

公共类HomeFragment扩展片段{

 公共静态最终乌里FRIEND_PICKER = Uri.parse(选择器://朋友);
私人FriendPickerFragment friendPickerFragment;
私有静态最后字符串变量=MainFragment;

@覆盖
公共查看onCreateView(LayoutInflater充气,容器的ViewGroup,
        捆绑savedInstanceState){
    super.onCreate(savedInstanceState);
    查看rootView = inflater.inflate(R.layout.home_fragment,集装箱,
            假);

    FragmentManager经理= getActivity()getSupportFragmentManager()。
    片段fragmentToShow = NULL;

    friendPickerFragment =新FriendPickerFragment();
    friendPickerFragment
            .setOnErrorListener(新PickerFragment.OnErrorListener(){
                @覆盖
                公共无效onerror的(PickerFragment<>的片段,
                        FacebookException错误){
                    Toast.makeText(getActivity(),error.getMessage(),
                            Toast.LENGTH_SHORT).show();
                }
            });
    friendPickerFragment
            .setOnDoneButtonClickedListener(新PickerFragment.OnDoneButtonClickedListener(){
                @覆盖
                公共无效onDoneButtonClicked(PickerFragment<>片段){
                    Toast.makeText(getActivity(),完成,
                            Toast.LENGTH_SHORT).show();
                }
            });
    fragmentToShow = friendPickerFragment;

    manager.beginTransaction()
            .replace(R.id.friend_picker_fragment,fragmentToShow).commit();

    返回rootView;
}

@覆盖
公共无效的OnStart(){
    super.onStart();
    尝试 {
        friendPickerFragment.loadData(假);
    }赶上(例外前){
    }
}

    }
 

解决方案

Facebook已经发布了其新的SDK近日,以提高安全性目的的水平。以下是一些需要使用Facebook SDK在您的应用程序。

检查这点首先

  1. 应用程序应发送的提交和需要得到的 facebook的队伍使用Facebook集成在自己的应用程序上市的朋友的细节,访问位置和访问其他审批特殊权限的审批手续是类似像在谷歌Play商店的应用程序列表。

  2. 应用程序必须列在谷歌播放,或者你可以有能力将其整合为一个测试用户(即像在谷歌玩beta测试)。

  3. 应用程序应该有一个正确的包名,开展活动,域名,网站的网址和电子邮件。

  4. 应用程序ID 注册必须用应用名称散列关键字匹配必须为用户开发具有<强产生>不同的机器

  5. 该示例应用程序的截图 说明应用标志需要添加

  6. 在从球队成功的批准后,它会显示你附近的应用程序名称一个积极的象征。

希望这有助于

i want display FriendPickerFragment in other fragment but i get empty list please help i cant find any info about thay

this is layout

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<FrameLayout
    android:id="@+id/friend_picker_fragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

</LinearLayout>

and this is code of fragment

public class HomeFragment extends Fragment {

public static final Uri FRIEND_PICKER = Uri.parse("picker://friend");
private FriendPickerFragment friendPickerFragment;
private static final String TAG = "MainFragment";

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    View rootView = inflater.inflate(R.layout.home_fragment, container,
            false);

    FragmentManager manager = getActivity().getSupportFragmentManager();
    Fragment fragmentToShow = null;

    friendPickerFragment = new FriendPickerFragment();
    friendPickerFragment
            .setOnErrorListener(new PickerFragment.OnErrorListener() {
                @Override
                public void onError(PickerFragment<?> fragment,
                        FacebookException error) {
                    Toast.makeText(getActivity(), error.getMessage(),
                            Toast.LENGTH_SHORT).show();
                }
            });
    friendPickerFragment
            .setOnDoneButtonClickedListener(new PickerFragment.OnDoneButtonClickedListener() {
                @Override
                public void onDoneButtonClicked(PickerFragment<?> fragment) {
                    Toast.makeText(getActivity(), "Done",
                            Toast.LENGTH_SHORT).show();
                }
            });
    fragmentToShow = friendPickerFragment;

    manager.beginTransaction()
            .replace(R.id.friend_picker_fragment, fragmentToShow).commit();

    return rootView;
}

@Override
public void onStart() {
    super.onStart();
    try {
        friendPickerFragment.loadData(false);
    } catch (Exception ex) {
    }
}

    }

解决方案

Facebook has released their new sdk recently to enhance the level of security purpose. The following are the few requirement to use facebook sdk in your app.

check this points first!!

  1. The app should send for the submission and needs to get approval from facebook team to use facebook integration in your own app for listing friends details, accessing locations and to access other special permissions The approval formalities are similar like store listing app in the google play.

  2. The application must be listed in the google play or you could able to integrate it as a test user(i.e like beta testing in google play).

  3. The application should have a proper package name, launching activity, domain name, website url and email.

  4. The app id registered must match with a app name and hash key must be generated for a user developing with different machines

  5. The sample screenshots of the application, description, and app logo needs to be added

  6. Once after the successful approval from the team it will show a active symbol near your app name.

Hope this help!!!

这篇关于空Facebook的FriendPickerFragment的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆