public void dialog ( Context context , String action , Bundle parameters , final DialogListener listener ) { String endpoint = DIALOG_BASE_URL + action ; parameters . putString ( "display" , "touch" ) ; parameters . putString ( "redirect_uri" , REDIRECT_URI ) ; if ( action . equals ( LOGIN ) ) { parameters . putString ( "type" , "user_agent" ) ; parameters . putString ( "client_id" , mAppId ) ; } else { parameters . putString ( "app_id" , mAppId ) ; } if ( isSessionValid ( ) ) { parameters . putString ( TOKEN , getAccessToken ( ) ) ; } String url = endpoint + "?" + Util . encodeUrl ( parameters ) ; if ( context . checkCallingOrSelfPermission ( Manifest . permission . INTERNET ) != PackageManager . PERMISSION_GRANTED ) { Util . showAlert ( context , "Error" , "Application requires permission to access the Internet" ) ; } else { new FbDialog ( context , url , listener ) . show ( ) ; } }
Generate a UI dialog for the request action in the given Android context with the provided parameters .