Last active
August 29, 2015 14:06
-
-
Save Shebella/2995e1c1b2d62d9ec701 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bundle params = new Bundle(); | |
params.putString("message", "YOUR_MESSAGE_HERE"); | |
WebDialog requestsDialog = ( | |
new WebDialog.RequestsDialogBuilder(getActivity(), | |
Session.getActiveSession(), | |
params)) | |
.setOnCompleteListener(new OnCompleteListener() { | |
@Override | |
public void onComplete(Bundle values, | |
FacebookException error) { | |
if (error != null) { | |
if (error instanceof FacebookOperationCanceledException) { | |
Toast.makeText(getActivity().getApplicationContext(), | |
"Request cancelled", | |
Toast.LENGTH_SHORT).show(); | |
} else { | |
Toast.makeText(getActivity().getApplicationContext(), | |
"Network Error", | |
Toast.LENGTH_SHORT).show(); | |
} | |
} else { | |
final String requestId = values.getString("request"); | |
if (requestId != null) { | |
Toast.makeText(getActivity().getApplicationContext(), | |
"Request sent", | |
Toast.LENGTH_SHORT).show(); | |
} else { | |
Toast.makeText(getActivity().getApplicationContext(), | |
"Request cancelled", | |
Toast.LENGTH_SHORT).show(); | |
} | |
} | |
} | |
}) | |
.build(); | |
requestsDialog.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment