How to pause an Activity till I get facebook id while signing in in Android?
<p>While using facebook in Android to log in/register, it takes a while for facebook to send the request. Thus, how do I pause the activity(show a process dialog) till I get the facebook id/username of the user who is trying to register? I can't do this in the base Listener as it is a background process. </p>

<p>I tried out using AsyncTask but I'm either confused how to do it or it can't be done. Mostly the former. I did this: </p>

<pre><code>  public class FacebookOperation extends AsyncTask&lt;Void, Void, Void&gt;
        {  





        @Override
        protected void onPreExecute()
        {  
            super.onPreExecute();



                mFacebook = new Facebook(APP_ID);
                mAsyncRunner = new AsyncFacebookRunner(mFacebook);
                reg = "facebook";
                SessionStore.restore(mFacebook, Register.this);
                SessionEvents.addAuthListener(new SampleAuthListener());
                //SessionEvents.addLogoutListener(new SampleLogoutListener());

        } 
        @Override 
        protected void onProgressUpdate(Void... values) {
            super.onProgressUpdate(values);

         }

        @Override 
        protected void onPostExecute(Void result)

        { 


               fillFormFb(); //Fills the form with the data from fb
        }

        @Override
        protected Void doInBackground(Void... params) {
            mLoginButton.init(Register.this, mFacebook,permissions);


            return null;
        }

          }
</code></pre>
