本文整理汇总了Java中com.xiaomi.mipush.sdk.ErrorCode.SUCCESS属性的典型用法代码示例。如果您正苦于以下问题:Java ErrorCode.SUCCESS属性的具体用法?Java ErrorCode.SUCCESS怎么用?Java ErrorCode.SUCCESS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.xiaomi.mipush.sdk.ErrorCode
的用法示例。
在下文中一共展示了ErrorCode.SUCCESS属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onReceiveRegisterResult
@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) {
Log.v(DemoApplication.TAG,
"onReceiveRegisterResult is called. " + message.toString());
String command = message.getCommand();
List<String> arguments = message.getCommandArguments();
String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
String log;
if (MiPushClient.COMMAND_REGISTER.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mRegId = cmdArg1;
//Log.d("register","success");
//log = context.getString(R.string.register_success);
} else {
//log = context.getString(R.string.register_fail);
}
} else {
//log = message.getReason();
}
/*Message msg = Message.obtain();
msg.obj = log;
DemoApplication.getHandler().sendMessage(msg);*/
}
示例2: onReceiveRegisterResult
@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) {
Log.v(MYTAG,
"onReceiveRegisterResult is called. " + message.toString());
String command = message.getCommand();
List<String> arguments = message.getCommandArguments();
String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
String log;
if (MiPushClient.COMMAND_REGISTER.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
deviceMiToken = cmdArg1;
Log.v(MYTAG,
"小米推送token:" + deviceMiToken);
} else {
Log.v(MYTAG,
"小米推送注册失败!" );
}
} else {
log = message.getReason();
}
}
示例3: onReceiveRegisterResult
@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) {
Log.v(MyApplication.TAG, "onReceiveRegisterResult is called. " + message.toString());
String command = message.getCommand();
List<String> arguments = message.getCommandArguments();
String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
String log;
if (MiPushClient.COMMAND_REGISTER.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mRegId = cmdArg1;
log = context.getString(R.string.register_success);
} else {
log = context.getString(R.string.register_fail);
}
} else {
log = message.getReason();
}
Message msg = Message.obtain();
msg.obj = log;
MyApplication.getHandler().sendMessage(msg);
}
示例4: onReceiveRegisterResult
@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) {
//注意:本回调在非主UI线程
Log4jLog.d(LONG_TAG, "onReceiveRegisterResult is called. " + message.toString());
String command = message.getCommand();
List<String> arguments = message.getCommandArguments();
String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
String log;
if (MiPushClient.COMMAND_REGISTER.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mRegId = cmdArg1;
log = "register_success, mRegId = " + mRegId;
ThirdPartyPushHelper.pushToken = mRegId;
ThirdPartyPushHelper.setPushToken(true);
} else {
log = "register_fail: " + message.getReason();
}
} else {
log = message.getReason();
}
Log4jLog.d(LONG_TAG, log);
}
示例5: onCommandResult
@Override
public void onCommandResult(Context context, MiPushCommandMessage message) {
String command = message.getCommand();
Log.d(TAG,"onCommandResult => " + message.toString());
List<String> arguments = message.getCommandArguments();
String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
String cmdArg2 = ((arguments != null && arguments.size() > 1) ? arguments.get(1) : null);
if (MiPushClient.COMMAND_REGISTER.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mRegId = cmdArg1;
}
} else if (MiPushClient.COMMAND_SET_ALIAS.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mAlias = cmdArg1;
}
} else if (MiPushClient.COMMAND_UNSET_ALIAS.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mAlias = cmdArg1;
}
} else if (MiPushClient.COMMAND_SUBSCRIBE_TOPIC.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mTopic = cmdArg1;
}
} else if (MiPushClient.COMMAND_UNSUBSCRIBE_TOPIC.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mTopic = cmdArg1;
}
} else if (MiPushClient.COMMAND_SET_ACCEPT_TIME.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mStartTime = cmdArg1;
mEndTime = cmdArg2;
}
}
}
示例6: onCommandResult
@Override
public void onCommandResult(Context context, MiPushCommandMessage message) {
Log.v(MyApplication.TAG,
"onCommandResult is called. " + message.toString());
String command = message.getCommand();
List<String> arguments = message.getCommandArguments();
String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
String cmdArg2 = ((arguments != null && arguments.size() > 1) ? arguments.get(1) : null);
String log;
if (MiPushClient.COMMAND_REGISTER.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mRegId = cmdArg1;
log = context.getString(R.string.register_success);
} else {
log = context.getString(R.string.register_fail);
}
} else if (MiPushClient.COMMAND_SET_ALIAS.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mAlias = cmdArg1;
log = context.getString(R.string.set_alias_success, mAlias);
} else {
log = context.getString(R.string.set_alias_fail, message.getReason());
}
} else if (MiPushClient.COMMAND_UNSET_ALIAS.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mAlias = cmdArg1;
log = context.getString(R.string.unset_alias_success, mAlias);
} else {
log = context.getString(R.string.unset_alias_fail, message.getReason());
}
} else if (MiPushClient.COMMAND_SET_ACCOUNT.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mAccount = cmdArg1;
log = context.getString(R.string.set_account_success, mAccount);
} else {
log = context.getString(R.string.set_account_fail, message.getReason());
}
} else if (MiPushClient.COMMAND_UNSET_ACCOUNT.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mAccount = cmdArg1;
log = context.getString(R.string.unset_account_success, mAccount);
} else {
log = context.getString(R.string.unset_account_fail, message.getReason());
}
} else if (MiPushClient.COMMAND_SUBSCRIBE_TOPIC.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mTopic = cmdArg1;
log = context.getString(R.string.subscribe_topic_success, mTopic);
} else {
log = context.getString(R.string.subscribe_topic_fail, message.getReason());
}
} else if (MiPushClient.COMMAND_UNSUBSCRIBE_TOPIC.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mTopic = cmdArg1;
log = context.getString(R.string.unsubscribe_topic_success, mTopic);
} else {
log = context.getString(R.string.unsubscribe_topic_fail, message.getReason());
}
} else if (MiPushClient.COMMAND_SET_ACCEPT_TIME.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mStartTime = cmdArg1;
mEndTime = cmdArg2;
log = context.getString(R.string.set_accept_time_success, mStartTime, mEndTime);
} else {
log = context.getString(R.string.set_accept_time_fail, message.getReason());
}
} else {
log = message.getReason();
}
MainActivity.logList.add(0, getSimpleDate() + " " + log);
Message msg = Message.obtain();
msg.obj = log;
MyApplication.getHandler().sendMessage(msg);
}
示例7: onReceiveRegisterResult
@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage miPushCommandMessage) {
Logger.d(TAG, "command result");
String command = miPushCommandMessage.getCommand();
List<String> arguments = miPushCommandMessage.getCommandArguments();
final String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
if (MiPushClient.COMMAND_REGISTER.equals(command)) {
if (miPushCommandMessage.getResultCode() == ErrorCode.SUCCESS && BizLogic.isLogin()) {
if (StringUtil.isBlank(MainApp.PREF_UTIL.getString(Constant.XIAOMI_TOKEN))) {
MainApp.PREF_UTIL.putString(Constant.XIAOMI_TOKEN, cmdArg1);
}
TalkClient.getInstance().getTalkApi()
.postToken(cmdArg1)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Action1<Object>() {
@Override
public void call(Object o) {
MainApp.PREF_UTIL.putString(Constant.XIAOMI_TOKEN, cmdArg1);
Logger.d(TAG, "xiaomi push register success: " + cmdArg1);
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
Logger.e(TAG, "xiaomi push register", throwable);
}
});
}
}
}
示例8: onCommandResult
/**
* 接收客户端向服务器发送命令消息后返回的响应
*
* @param context
* @param message
*/
@Override
public void onCommandResult(Context context, MiPushCommandMessage message) {
String command = message.getCommand();
List<String> arguments = message.getCommandArguments();
String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
String cmdArg2 = ((arguments != null && arguments.size() > 1) ? arguments.get(1) : null);
if (MiPushClient.COMMAND_REGISTER.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mRegId = cmdArg1;
}
} else if (MiPushClient.COMMAND_SET_ALIAS.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mAlias = cmdArg1;
}
} else if (MiPushClient.COMMAND_UNSET_ALIAS.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mAlias = cmdArg1;
}
} else if (MiPushClient.COMMAND_SUBSCRIBE_TOPIC.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mTopic = cmdArg1;
}
} else if (MiPushClient.COMMAND_UNSUBSCRIBE_TOPIC.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mTopic = cmdArg1;
}
} else if (MiPushClient.COMMAND_SET_ACCEPT_TIME.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mStartTime = cmdArg1;
mEndTime = cmdArg2;
}
}
}
示例9: onReceiveRegisterResult
/**
* 接受客户端向服务器发送注册命令消息后返回的响应
*
* @param context
* @param message
*/
@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) {
String command = message.getCommand();
List<String> arguments = message.getCommandArguments();
String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
String cmdArg2 = ((arguments != null && arguments.size() > 1) ? arguments.get(1) : null);
if (MiPushClient.COMMAND_REGISTER.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mRegId = cmdArg1;
}
}
// Log.d("TAG", "register:" + mRegId);
SPUtils.putString("regId", mRegId).commit();
}
示例10: onReceiveRegisterResult
/**
* 获取给服务器发送注册命令的结果,结果封装在MiPushCommandMessage类中
*/
@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) {
String command = message.getCommand();
List<String> arguments = message.getCommandArguments();
String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
String cmdArg2 = ((arguments != null && arguments.size() > 1) ? arguments.get(1) : null);
if (MiPushClient.COMMAND_REGISTER.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mRegId = cmdArg1;
}
}
}
示例11: onReceiveRegisterResult
/**
* 用来接受客户端向服务器发送注册命令消息后返回的响应
*
* @param context
* @param message
*/
@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) {
Logger.v(TAG + "onReceiveRegisterResult" + message.toString());
String command = message.getCommand();
List<String> arguments = message.getCommandArguments();
String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
String cmdArg2 = ((arguments != null && arguments.size() > 1) ? arguments.get(1) : null);
if (MiPushClient.COMMAND_REGISTER.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mRegId = cmdArg1;
}
}
}
示例12: onCommandResult
/**
* 用来接收客户端向服务器发送命令消息后返回的响应
*
* @param context
* @param message
*/
@Override
public void onCommandResult(Context context, MiPushCommandMessage message) {
Logger.v(TAG + "onCommandResult" + message.toString());
String command = message.getCommand();
List<String> arguments = message.getCommandArguments();
String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
String cmdArg2 = ((arguments != null && arguments.size() > 1) ? arguments.get(1) : null);
if (MiPushClient.COMMAND_REGISTER.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mRegId = cmdArg1;
}
} else if (MiPushClient.COMMAND_SET_ALIAS.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mAlias = cmdArg1;
}
} else if (MiPushClient.COMMAND_UNSET_ALIAS.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mAlias = cmdArg1;
}
} else if (MiPushClient.COMMAND_SUBSCRIBE_TOPIC.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mTopic = cmdArg1;
}
} else if (MiPushClient.COMMAND_UNSUBSCRIBE_TOPIC.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mTopic = cmdArg1;
}
} else if (MiPushClient.COMMAND_SET_ACCEPT_TIME.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mStartTime = cmdArg1;
mEndTime = cmdArg2;
}
}
}
示例13: onReceiveRegisterResult
@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) {
String command = message.getCommand();
if (MiPushClient.COMMAND_REGISTER.equals(command)) {
if (mRemoteMessageSDKStateHandler != null) {
mRemoteMessageSDKStateHandler.onReceiveRegisterResult(message.getResultCode() == ErrorCode.SUCCESS);
}
if (message.getResultCode() == ErrorCode.SUCCESS) {
updateContent(context, context.getString(R.string.msg_push_binded));
} else {
updateContent(context, "注册失败,错误码:" + message.getResultCode());
}
}
}
示例14: onCommandResult
@Override
public void onCommandResult(Context arg0, MiPushCommandMessage message) {
String command = message.getCommand();
List<String> arguments = message.getCommandArguments();
String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
if (MiPushClient.COMMAND_REGISTER.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
MyApplication.Push_Reg_ID = cmdArg1;
} else {
MyApplication.Push_Reg_ID = "";
}
} else {
MyApplication.Push_Reg_ID = "";
}
}
示例15: onCommandResult
@Override
public void onCommandResult(Context context, MiPushCommandMessage message) {
String command = message.getCommand();
List<String> arguments = message.getCommandArguments();
String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
String cmdArg2 = ((arguments != null && arguments.size() > 1) ? arguments.get(1) : null);
String log;
if (MiPushClient.COMMAND_REGISTER.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mRegId = cmdArg1;
//log = context.getString(R.string.register_success);
} else {
//log = context.getString(R.string.register_fail);
}
} else if (MiPushClient.COMMAND_SET_ALIAS.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mAlias = cmdArg1;
//log = context.getString(R.string.set_alias_success, mAlias);
} else {
//log = context.getString(R.string.set_alias_fail, message.getReason());
}
} else if (MiPushClient.COMMAND_UNSET_ALIAS.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mAlias = cmdArg1;
//log = context.getString(R.string.unset_alias_success, mAlias);
} else {
//log = context.getString(R.string.unset_alias_fail, message.getReason());
}
} else if (MiPushClient.COMMAND_SET_ACCOUNT.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mAccount = cmdArg1;
//log = context.getString(R.string.set_account_success, mAccount);
} else {
//log = context.getString(R.string.set_account_fail, message.getReason());
}
} else if (MiPushClient.COMMAND_UNSET_ACCOUNT.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mAccount = cmdArg1;
//log = context.getString(R.string.unset_account_success, mAccount);
} else {
//log = context.getString(R.string.unset_account_fail, message.getReason());
}
} else if (MiPushClient.COMMAND_SUBSCRIBE_TOPIC.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mTopic = cmdArg1;
//log = context.getString(R.string.subscribe_topic_success, mTopic);
} else {
//log = context.getString(R.string.subscribe_topic_fail, message.getReason());
}
} else if (MiPushClient.COMMAND_UNSUBSCRIBE_TOPIC.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mTopic = cmdArg1;
//log = context.getString(R.string.unsubscribe_topic_success, mTopic);
} else {
//log = context.getString(R.string.unsubscribe_topic_fail, message.getReason());
}
} else if (MiPushClient.COMMAND_SET_ACCEPT_TIME.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
mStartTime = cmdArg1;
mEndTime = cmdArg2;
//log = context.getString(R.string.set_accept_time_success, mStartTime, mEndTime);
} else {
//log = context.getString(R.string.set_accept_time_fail, message.getReason());
}
} else {
//log = message.getReason();
}
//MainActivity.logList.add(0, getSimpleDate() + " " + log);
/*Message msg = Message.obtain();
msg.obj = log;
DemoApplication.getHandler().sendMessage(msg);*/
}