Click here to Skip to main content
15,917,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am trying to integrate fb login in my app . i will login to facebook and when the login is successful i want to start an activity of my app . i am using a custom login icon .. your suggestion will be very appreciated :) ...
Posted

1 solution

You can implement the activity intent at the Session.StatusCallback, after the session facebook is opened
For example:

Java
private Session.StatusCallback statusCallback = new Session.StatusCallback() {
		@Override
		public void call(Session session, SessionState state,
				Exception exception) {
			if (state.isOpened()) {
				Log.d(TAG, "Facebook session opened.");
				if (session.isOpened()) {
					Log.d(TAG, session.getAccessToken());					
					Intent intent = new Intent(this,
							MainActivity.class);
					startActivity(intent);
				}
			} else if (state.isClosed()) {
				Log.d(TAG, "Facebook session closed.");
			}
		}
	};
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900