Facebook requestCodes

前端 未结 7 748
予麋鹿
予麋鹿 2021-02-02 11:26

I have an Activity that should handle results from both the Facebook SDK, and from other custom Activities.

Where can I find the requestCodes used by the Facebook SDK, i

7条回答
  •  遥遥无期
    2021-02-02 12:07

    Try this:

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data)
    {
        super.onActivityResult(requestCode, resultCode, data);
    
        //Log.iClassMethod();
    
        switch(requestCode)
        {
            case 1:
                if (resultCode == Activity.RESULT_OK)
                {
                    // do something ...
                }
                break;
    
            case ...:
                if (resultCode == Activity.RESULT_OK)
                {
                    // do something ...
                }
                break;
    
            case Session.DEFAULT_AUTHORIZE_ACTIVITY_CODE:
            {
                Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
                Log.i("Facebook");
            }
            break;
        }
    }
    

提交回复
热议问题