How Dialog to facebook android sdk closes immediately

I use the Facebook Android SDK (3.19) in my application and follow this link https://developers.facebook.com/docs/android/like-button to use the Like button. When I clicked on the button, β€œLike a dialogue” was shown and fired immediately. In addition, onActivityResult was not called. I do not know why. Please help me fix this. Thanks.

Edit: My code

public class ContentFragment extends Fragment{ LikeView likeView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); Settings.sdkInitialize(getActivity()); Settings.setPlatformCompatibilityEnabled(false); Settings.setIsDebugEnabled(true); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = LayoutInflater.from(getActivity()).inflate(R.layout.content_fragment, null); likeView = (LikeView) view.findViewById(R.id.like_view); likeView.setObjectId("http://shareitexampleapp.parseapp.com/photo1/"); } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); LikeView.handleOnActivityResult(getActivity(), requestCode, resultCode, data); Toast.makeText(getActivity(), "onActivityResult", Toast.LENGTH_SHORT).show(); } } 

Edit2: CLOSED. That's my fault. My test account has not been added to my facebook testers. Thanks.

+5
source share

Source: https://habr.com/ru/post/1204318/


All Articles