(huawei-topon)凤起Android海外sdk

(huawei-topon)凤起Android海外sdk文档


3.3 切换账号

<h3>3.3.1 切换账号调用示例(分为两个步骤):</h3> <h3><font color=red>注意:必须在MainActivity的OnCreate中调用监听方法:setSwitchAccountListener</font></h3> <h4>步骤 1:设置切换账号监听</h4> <pre><code>FqGame.setSwitchAccountListener(new SwitchAccountListener() { @Override public void onLogout() { //登出操作 如保存被切换玩家的信息 } });</code></pre> <h4>步骤 2:调用切换账号方法 (游戏切换账号时调用此方法)</h4> <pre><code>FqGame.switchAccount();</code></pre> <h3>3.3.2 传入参数说明</h3> <pre><code>步骤 1: 参数 1:接收切换账号回调 SwitchAccountListener 实例 步骤 2: 无需传参</code></pre> <h3>3.3.3 切换结果 SwitchAccountListener 接口回调说明</h3> <table> <thead> <tr> <th style="text-align: left;">方法名</th> <th style="text-align: left;">描述</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">onLogout()</td> <td style="text-align: left;">CP 调用 FqGame.switchAccount()方法进行切换账号时,会回调 FqGame.setSwitchAccountListener()设置的监听器中 onLogout(), CP 在 onLogout()进行登出操作。凤起 SDK 会自动弹出登录界面,重新登录后会将登录结果回调给之前登录接口中设置的同一个 IResult。</td> </tr> </tbody> </table>

页面列表

ITEM_HTML