本文整理汇总了Java中org.telegram.tgnet.TLRPC.TL_auth_resendCode方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.TL_auth_resendCode方法的具体用法?Java TLRPC.TL_auth_resendCode怎么用?Java TLRPC.TL_auth_resendCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.tgnet.TLRPC
的用法示例。
在下文中一共展示了TLRPC.TL_auth_resendCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resendCode
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void resendCode() {
final Bundle params = new Bundle();
params.putString("phone", phone);
params.putString("ephone", emailPhone);
params.putString("phoneFormated", requestPhone);
nextPressed = true;
needShowProgress();
TLRPC.TL_auth_resendCode req = new TLRPC.TL_auth_resendCode();
req.phone_number = requestPhone;
req.phone_code_hash = phoneHash;
ConnectionsManager.getInstance().sendRequest(req, new RequestDelegate() {
@Override
public void run(final TLObject response, final TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
nextPressed = false;
if (error == null) {
fillNextCodeParams(params, (TLRPC.TL_auth_sentCode) response);
} else {
if (error.text != null) {
if (error.text.contains("PHONE_NUMBER_INVALID")) {
needShowAlert(LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber));
} else if (error.text.contains("PHONE_CODE_EMPTY") || error.text.contains("PHONE_CODE_INVALID")) {
needShowAlert(LocaleController.getString("InvalidCode", R.string.InvalidCode));
} else if (error.text.contains("PHONE_CODE_EXPIRED")) {
onBackPressed();
setPage(0, true, null, true);
needShowAlert(LocaleController.getString("CodeExpired", R.string.CodeExpired));
} else if (error.text.startsWith("FLOOD_WAIT")) {
needShowAlert(LocaleController.getString("FloodWait", R.string.FloodWait));
} else if (error.code != -1000) {
needShowAlert(LocaleController.getString("ErrorOccurred", R.string.ErrorOccurred) + "\n" + error.text);
}
}
}
needHideProgress();
}
});
}
}, ConnectionsManager.RequestFlagFailOnServerErrors);
}
示例2: resendCode
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void resendCode() {
final Bundle params = new Bundle();
params.putString("phone", phone);
params.putString("ephone", emailPhone);
params.putString("phoneFormated", requestPhone);
nextPressed = true;
needShowProgress();
TLRPC.TL_auth_resendCode req = new TLRPC.TL_auth_resendCode();
req.phone_number = requestPhone;
req.phone_code_hash = phoneHash;
ConnectionsManager.getInstance().sendRequest(req, new RequestDelegate() {
@Override
public void run(final TLObject response, final TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
nextPressed = false;
if (error == null) {
fillNextCodeParams(params, (TLRPC.TL_auth_sentCode) response);
} else {
if (error.text != null) {
if (error.text.contains("PHONE_NUMBER_INVALID")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber));
} else if (error.text.contains("PHONE_CODE_EMPTY") || error.text.contains("PHONE_CODE_INVALID")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidCode", R.string.InvalidCode));
} else if (error.text.contains("PHONE_CODE_EXPIRED")) {
onBackPressed();
setPage(0, true, null, true);
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("CodeExpired", R.string.CodeExpired));
} else if (error.text.startsWith("FLOOD_WAIT")) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("FloodWait", R.string.FloodWait));
} else if (error.code != -1000) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("ErrorOccurred", R.string.ErrorOccurred) + "\n" + error.text);
}
}
}
needHideProgress();
}
});
}
}, ConnectionsManager.RequestFlagFailOnServerErrors | ConnectionsManager.RequestFlagWithoutLogin);
}