i'm trying to log in with facebook and pass the user's info to another activity The problem is when i run the startActivity method with the intent the onclick event gets freeze's and doesn't do anything
I created a class that implements Serializable that holds a couple of strings
then when the user log in with facebook i create an instance of that class so i can pass it on to the other activity
heres the code:
Session.openActiveSession(me, true, new StatusCallback()
{
@Override
public void call(Session session, SessionState state, Exception exception)
{
if(session.isOpened())
{
Request.executeMeRequestAsync(session, new Request.GraphUserCallback()
{
@Override
public void onCompleted(GraphUser user, Response response)
{
if(user!=null)
{
GraphLocation location= user.getLocation();
String address = location.getStreet()+","+location.getCity()+","+location.getState()+","+location.getCountry();
b.setVisibility(View.VISIBLE);
Fuser = new FBuser(
user.getName(),
user.getFirstName(),
user.getLastName(),
user.getBirthday(),
user.getId(),
user.getInnerJSONObject(),
user.getLink(),
address,
user.getUsername());
}
}
});
}
}
});
as you can see I set a button to be visible and when the user clicks the button i start the activity and pass with it the user object:
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v)
{
final Login log = (Login) me;
final FBuser user = Fuser;
final Intent i = new Intent(getBaseContext(),Profile.class);
i.putExtra("user", user);
try
{
log.startActivity(i);
}
catch (Exception e)
{
e.getMessage();
}
}
});
}
But nothing happends the button freeze's and nothing happends.
Any ideas why this could happend?