Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9079625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:52:44+00:00 2026-06-16T19:52:44+00:00

I am developing an android app which is intended to use Facebook login.Users will

  • 0

I am developing an android app which is intended to use Facebook login.Users will log into the app using their Facebook credentials.All is working fine when the Facebook for android app is not installed.However,when the device has the Facebook for android app installed,the app doesn’t get beyond the login interface.How can i rectify that?Any assistance will be highly appreciated.Thanks.
Below is the code for the login activity.

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import com.facebook.*;
import com.facebook.model.*;
import com.facebook.Session;


public class MokoActivity extends Activity implements OnClickListener{
    TextView create_account;
    EditText name;
    //private UiLifecycleHelper uiHelper;
    private boolean isResumed=false;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        create_account=(TextView)findViewById(R.id.textView_createAccount);
        name=(EditText)findViewById(R.id.editText_name);
        create_account.setOnClickListener(this);
    }

    public void onClick(View v) {
        // TODO Auto-generated method stub
        switch(v.getId()){
        case R.id.textView_createAccount:
                String user_name=name.getText().toString();
                if(user_name.length()<4){
                    Toast toast=Toast.makeText(MokoActivity.this,"Invalid Name",Toast.LENGTH_LONG);
                    toast.show();
                }

                else{
            Session.openActiveSession(this, true,new Session.StatusCallback(){
                public void call(Session session,SessionState state,Exception exception){
                    if(state.isOpened()){
                        Intent intent=new Intent(MokoActivity.this,HomeActivity.class);
                        intent.putExtra("username",name.getText().toString());
                        startActivity(intent);
                    }
                }
            });
            }
            break;
        }
    }

    public void onResume(){
        Session session=Session.getActiveSession();
        if(session != null && (session.isOpened() || session.isClosed())){
            onSessionStateChange(session, session.getState(), null);
        }
        super.onResume();
         isResumed = true;
    }

    @Override
    public void onPause() {
        super.onPause();
        isResumed = false;
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }

    private void onSessionStateChange(Session session, SessionState state, Exception exception) {
        if(isResumed){
        if (state.isOpened()) {
            Intent intent=new Intent(MokoActivity.this,HomeActivity.class);
            intent.putExtra("username",name.getText().toString());
            startActivity(intent);
        } 
        else if (state.isClosed()) {
            Toast toast=Toast.makeText(MokoActivity.this,"Logged out...",Toast.LENGTH_LONG);
            toast.show();
          }
        }
    }
    @Override
      public void onActivityResult(int requestCode, int resultCode, Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
          Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
      }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T19:52:45+00:00Added an answer on June 16, 2026 at 7:52 pm

    In your FACEBOOK SDK LIBRARY PROJECT .
    in FACEBOOK.JAVA line nos from 181 to 199 replace with the following codes.

    **public void authorize(Activity activity, String[] permissions,
                int activityCode, final DialogListener listener) {
           // boolean singleSignOnStarted = false;
            mAuthDialogListener = listener;
          /*  // Prefer single sign-on, where available.
            if (activityCode >= 0) {
                singleSignOnStarted = startSingleSignOn(activity, mAppId,
                        permissions, activityCode);
            }
            // Otherwise fall back to traditional dialog.
            if (!singleSignOnStarted) {
                startDialogAuth(activity, permissions);
            }*/
    
            startDialogAuth(activity, permissions);
        }**
    

    it will work perfectly only in api wont get link with facebook app which installed in mobile.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an Android app, which will use C2DM . In order to
I am developing an Android App which gives users an option 'Browse Alphanumerically'. Using
I'm developing an Android app which will use C2DM to handle push notifications. Now
I'm thinking about developing an iPhone/Android app which will include a server side. For
I am currently developing an app which will be on Android Market. How can
Im developing an Android App which uses the new Facebook 3 SDK. I make
I'm currently developing an Android app, which loads events from a server using JSON
I am developing an app which is similiar to android facebook app. I got
I'm developing an Android app which based on a web-server. Users, who installed the
I am developing an Android app. It has a login page in which I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.