How to display the login information in different layout?
<p>I have created an application which needs sign in from Facebook/Twitter/Google to get started. In a layout I have created three <strong>switches</strong> each for Facebook, Twitter and Google which has options ON and OFF. I want to make the switch of the particular account as 'ON' if the user is logged in from that corresponding account. Example if the user is logged in from Facebook, only the switch beside Facebook should be ON. How can I do that?</p>

<p>Any suggestions would be appreciated, and also if somebody know then please refer me to any tutorial related to this.
Below is my code for the login page. I have shown the login for Facebook part:
Thanx :)</p>

<pre><code>private OnClickListener loginButtonListener = new OnClickListener() {
        @SuppressWarnings("deprecation")
        public void onClick( View v ) {
            String[] permissions = { "offline_access", "publish_stream", "user_photos", "publish_checkins","photo_upload" };


            if(v.getId() == R.id.button1 )
            {
                facebookSwitch = true;
                twitterSwitch = false;
                googleSwitch = false;
                if( !mFacebook.isSessionValid() ) {
                    Toast.makeText(Login.this, "Authorizing", Toast.LENGTH_SHORT).show();
                    mFacebook.authorize(Login.this, permissions, new LoginDialogListener());
                }
                else {
                    Toast.makeText( Login.this, "Has valid session", Toast.LENGTH_SHORT).show();
                    try {
                        JSONObject json = Util.parseJson(mFacebook.request("me"));
                        //Log.d("Login", "11111111111111111");
                        String facebookID = json.getString("id");
                        //Log.d("Login", "22222222222222"); 

                        String firstName = json.getString("first_name");
                        //Log.d("Login", "3333333333333333333");

                        String lastName = json.getString("last_name");
                        //Log.d("Login", "4444444444444444444444");

                        Toast.makeText(Login.this, "You already have a valid session, " + firstName + " " + lastName + ". No need to re-authorize.", Toast.LENGTH_LONG).show();
                        Intent intent = new Intent(Login.this,MainActivity.class);
                        startActivity(intent);
                    }
                    catch( Exception error ) {
                        Toast.makeText( Login.this, error.toString(), Toast.LENGTH_SHORT).show();
                    }
                    catch( FacebookError error ) {
                        Toast.makeText( Login.this, error.toString(), Toast.LENGTH_SHORT).show();
                    }
                }
            }
</code></pre>
