Matteo Cardellini
Matteo Cardellini

Reputation: 896

Facebook Request Dialog return bundle

In this page I have seen that you can take two return data from a Request Dialog: "request" and "to" so i have done this

new Facebook.DialogListener() {
    public void onComplete(Bundle values) {
    Log.i("Bundle",values.toString());
    int[] nArray = values.getIntArray("to");
    int n = nArray.length;
}

But i Have a NullPointerException when i use the n variable. I am not sure that "to" is an intArray can someone tell me what is the type of nArray ?

Upvotes: 0

Views: 479

Answers (2)

user1121851
user1121851

Reputation:

Try with this:

Set<String> keys = values.keySet();
int n = keys.size() - 1;

Now n is the number of friends you have invited !

Upvotes: 2

Jesse Chen
Jesse Chen

Reputation: 4928

Have you tried using the debugger to step through this code? You can set a breakpoint and try to call different methods in the Expressions tab of Eclipse to try and find out the right data type.

Also, what is the output of your Log message (values.toString())?

Upvotes: 1

Related Questions