本文整理汇总了Java中cn.smssdk.utils.SMSLog类的典型用法代码示例。如果您正苦于以下问题:Java SMSLog类的具体用法?Java SMSLog怎么用?Java SMSLog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SMSLog类属于cn.smssdk.utils包,在下文中一共展示了SMSLog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onKeyEvent
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
public boolean onKeyEvent(int keyCode, KeyEvent event) {
try {
int resId = ResHelper.getIdRes(activity, "llSearch");
if (keyCode == KeyEvent.KEYCODE_BACK
&& event.getAction() == KeyEvent.ACTION_DOWN
&& activity.findViewById(resId).getVisibility() == View.VISIBLE) {
activity.findViewById(resId).setVisibility(View.GONE);
resId = ResHelper.getIdRes(activity, "llTitle");
activity.findViewById(resId).setVisibility(View.VISIBLE);
etSearch.setText("");
return true;
}
} catch (Throwable e) {
SMSLog.getInstance().w(e);
}
return super.onKeyEvent(keyCode, event);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:CountryPage.java
示例2: onKeyEvent
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
public boolean onKeyEvent(int keyCode, KeyEvent event) {
try {
int resId = ResHelper.getIdRes(activity, "llSearch");
if (keyCode == KeyEvent.KEYCODE_BACK
&& event.getAction() == KeyEvent.ACTION_DOWN
&& activity.findViewById(resId).getVisibility() == View.VISIBLE) {
activity.findViewById(resId).setVisibility(View.GONE);
resId = ResHelper.getIdRes(activity, "llTitle");
activity.findViewById(resId).setVisibility(View.VISIBLE);
etSearch.setText("");
return true;
}
} catch (Exception e) {
SMSLog.getInstance().w(e);
}
return super.onKeyEvent(keyCode, event);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:ContactsPage.java
示例3: onKeyEvent
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
public boolean onKeyEvent(int keyCode, KeyEvent event) {
try {
int resId = Res.id.llSearch;
if (keyCode == KeyEvent.KEYCODE_BACK
&& event.getAction() == KeyEvent.ACTION_DOWN
&& activity.findViewById(resId).getVisibility() == View.VISIBLE) {
activity.findViewById(resId).setVisibility(View.GONE);
resId = Res.id.llTitle;
activity.findViewById(resId).setVisibility(View.VISIBLE);
etSearch.setText("");
return true;
}
} catch (Throwable e) {
SMSLog.getInstance().w(e);
}
return super.onKeyEvent(keyCode, event);
}
开发者ID:zzlnewair,项目名称:Myshop,代码行数:18,代码来源:CountryPage.java
示例4: onKeyEvent
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
public boolean onKeyEvent(int keyCode, KeyEvent event) {
try {
int resId = Res.id.llSearch;
if (keyCode == KeyEvent.KEYCODE_BACK
&& event.getAction() == KeyEvent.ACTION_DOWN
&& activity.findViewById(resId).getVisibility() == View.VISIBLE) {
activity.findViewById(resId).setVisibility(View.GONE);
resId = Res.id.llTitle;
activity.findViewById(resId).setVisibility(View.VISIBLE);
etSearch.setText("");
return true;
}
} catch (Exception e) {
SMSLog.getInstance().w(e);
}
return super.onKeyEvent(keyCode, event);
}
开发者ID:zzlnewair,项目名称:Myshop,代码行数:18,代码来源:ContactsPage.java
示例5: prepare
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
public static void prepare(final Context context, final Runnable afterPrepare) {
Runnable act = new Runnable() {
public void run() {
synchronized (DB_FILE) {
if (hanzi2Pinyin == null || hanzi2Pinyin.size() <= 0) {
try {
int resId = ResHelper.getRawRes(context, DB_FILE);
if (resId <= 0) {
hanzi2Pinyin = new HashMap<String, Object>();
} else {
InputStream is = context.getResources().openRawResource(resId);
GZIPInputStream gzis = new GZIPInputStream(is);
InputStreamReader isr = new InputStreamReader(gzis);
BufferedReader br = new BufferedReader(isr);
String json = br.readLine();
br.close();
hanzi2Pinyin = new Hashon().fromJson(json);
}
} catch (Throwable t) {
SMSLog.getInstance().w(t);
hanzi2Pinyin = new HashMap<String, Object>();
}
}
if (afterPrepare != null) {
afterPrepare.run();
}
}
}
};
if (afterPrepare != null) {
new Thread(act).start();
} else {
act.run();
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:37,代码来源:SearchEngine.java
示例6: getCurrentCountry
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
private String[] getCurrentCountry() {
String mcc = getMCC();
String[] country = null;
if (!TextUtils.isEmpty(mcc)) {
country = SMSSDK.getCountryByMCC(mcc);
}
if (country == null) {
SMSLog.getInstance().d("no country found by MCC: " + mcc);
country = SMSSDK.getCountry(DEFAULT_COUNTRY_ID);
}
return country;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:RegisterPage.java
示例7: getItem
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
public String[] getItem(int group, int position) {
String[] countriesArray = null;
if(countries.size() != 0){
try {
countriesArray = countries.get(group).get(position);
} catch (Throwable e) {
SMSLog.getInstance().w(e);
}
return countriesArray;
} else {
return null;
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:CountryAdapter.java
示例8: prepare
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
public static void prepare(final Context context, final Runnable afterPrepare) {
Runnable act = new Runnable() {
public void run() {
synchronized (DB_FILE) {
if (hanzi2Pinyin == null || hanzi2Pinyin.size() <= 0) {
try {
int resId = getRawRes(context, DB_FILE);
if (resId <= 0) {
hanzi2Pinyin = new HashMap<String, Object>();
} else {
InputStream is = context.getResources().openRawResource(resId);
GZIPInputStream gzis = new GZIPInputStream(is);
InputStreamReader isr = new InputStreamReader(gzis);
BufferedReader br = new BufferedReader(isr);
String json = br.readLine();
br.close();
hanzi2Pinyin = new Hashon().fromJson(json);
}
} catch (Throwable t) {
SMSLog.getInstance().w(t);
hanzi2Pinyin = new HashMap<String, Object>();
}
}
if (afterPrepare != null) {
afterPrepare.run();
}
}
}
};
if (afterPrepare != null) {
new Thread(act).start();
} else {
act.run();
}
}
开发者ID:zzlnewair,项目名称:Myshop,代码行数:37,代码来源:SearchEngine.java
示例9: getItem
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
public String[] getItem(int group, int position) {
String[] countriesArray = null;
if(countries.size() != 0){
try {
countriesArray = countries.get(group).get(position);
} catch (Throwable e) {
SMSLog.getInstance().w(e);
}
return countriesArray;
}else{
return null;
}
}
开发者ID:zzlnewair,项目名称:Myshop,代码行数:14,代码来源:CountryAdapter.java
示例10: afterEvent
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
@Override
public void afterEvent(final int event, final int result,
final Object data) {
runOnUiThread(() -> {
if (result == SMSSDK.RESULT_COMPLETE) {
if (event == SMSSDK.EVENT_GET_SUPPORTED_COUNTRIES) {
onCountryListGot((ArrayList<HashMap<String, Object>>) data);
} else if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
// 请求验证码后,跳转到验证码填写页面
afterVerificationCodeRequested((Boolean) data);
} else if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
}
} else {
// 根据服务器返回的网络错误,给toast提示
try {
((Throwable) data).printStackTrace();
Throwable throwable = (Throwable) data;
JSONObject object = new JSONObject(
throwable.getMessage());
String des = object.optString("detail");
if (!TextUtils.isEmpty(des)) {
//ToastUtils.show(RegActivity.this, des);
return;
}
} catch (Exception e) {
SMSLog.getInstance().w(e);
}
}
});
}
开发者ID:wuyinlei,项目名称:MyHearts,代码行数:41,代码来源:CorrectPasswordFirst.java
示例11: afterEvent
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
@Override
public void afterEvent(final int event, final int result,
final Object data) {
runOnUiThread(() -> {
if (result == SMSSDK.RESULT_COMPLETE) {
if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
HashMap<String, Object> phoneMap = (HashMap<String, Object>) data;
String country = (String) phoneMap.get("country");
String phone1 = (String) phoneMap.get("phone");
doRegister();
// dialog.setMessage("正在提交注册信息");
// dialog.show();;
}
} else {
// 根据服务器返回的网络错误,给toast提示
try {
((Throwable) data).printStackTrace();
Throwable throwable = (Throwable) data;
JSONObject object = new JSONObject(
throwable.getMessage());
String des = object.optString("detail");
if (!TextUtils.isEmpty(des)) {
// ToastUtils.show(RegActivity.this, des);
return;
}
} catch (Exception e) {
SMSLog.getInstance().w(e);
}
}
});
}
开发者ID:wuyinlei,项目名称:MyHearts,代码行数:39,代码来源:RegisterSecondActivity.java
示例12: afterEvent
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
@Override
public void afterEvent(final int event, final int result,
final Object data) {
runOnUiThread(() -> {
if (result == SMSSDK.RESULT_COMPLETE) {
if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
HashMap<String, Object> phoneMap = (HashMap<String, Object>) data;
String country = (String) phoneMap.get("country");
String phone1 = (String) phoneMap.get("phone");
doRegister();
// dialog.setMessage("正在提交注册信息");
// dialog.show();;
}
} else {
// 根据服务器返回的网络错误,给toast提示
try {
((Throwable) data).printStackTrace();
Throwable throwable = (Throwable) data;
JSONObject object = new JSONObject(
throwable.getMessage());
String des = object.optString("detail");
if (!TextUtils.isEmpty(des)) {
ToastUtils.show(RegisterSecondActivity.this, des);
return;
}
} catch (Exception e) {
SMSLog.getInstance().w(e);
}
}
});
}
开发者ID:wuyinlei,项目名称:TravelAround,代码行数:39,代码来源:RegisterSecondActivity.java
示例13: SMSReceiver
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
/**
* 不要使用AndroidManifest.xml配置的方式注册Receiver,
* 请使用Context.registerReceiver注册监听器, 因为初始化的时候要传入监听器
*/
public SMSReceiver() {
String msg = "Please dynamically register an instance of this class with Context.registerReceiver."
+ "\r\nIf not, the SMSSDK.VerifyCodeReadListener will be null!";
SMSLog.getInstance().i("SMSReceiver:" + msg);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:SMSReceiver.java
示例14: handleMessage
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
@Override
public void handleMessage(Message msg) {
final RegActivity activity = activityWeakReference.get();
int event = msg.arg1;
int result = msg.arg2;
Object data = msg.obj;
if (result == SMSSDK.RESULT_COMPLETE) {
//正确进行
if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
//获取验证码
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(activity, "验证码已发送",
Toast.LENGTH_SHORT).show();
activity.startVerCodeCountDown();
}
});
} else if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
//验证码正确
activity.checkVerCode = true;
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
activity.stopUIDialog();
}
});
//执行注册逻辑
if (activity.checkPassword() && activity.checkVerCode) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
//打开正在注册对话框
activity.startRegUIDialog();
String disCode = activity.nonspaceConvert(activity.editDisCode.getText().toString()); //区号
String phoneNum = activity.nonspaceConvert(activity.editPhone.getText().toString()); //手机号码
String password = activity.editPassword.getText().toString(); //密码
//开启网络请求
activity.addUserOnServer(disCode, phoneNum, password);
}
});
}
}
} else {
//出现异常
int status = 0;
try{
((Throwable) data).printStackTrace();
Throwable throwable = (Throwable) data;
JSONObject object = new JSONObject(throwable.getMessage());
final String des = object.optString("detail");
status = object.optInt("status");
if (!TextUtils.isEmpty(des)) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
activity.stopUIDialog();
Toast.makeText(activity, des, Toast.LENGTH_SHORT).show();
}
});
}
} catch (Exception e) {
SMSLog.getInstance().w(e);
}
}
}
开发者ID:838030195,项目名称:DaiGo,代码行数:77,代码来源:RegActivity.java
示例15: handleMessage
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
@Override
public void handleMessage(Message msg) {
final FragmentVerifyPhone fragment = fragmentVerifyPhoneWeakReference.get();
int event = msg.arg1;
int result = msg.arg2;
Object data = msg.obj;
if (result == SMSSDK.RESULT_COMPLETE) {
//正确进行
if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
//获取验证码
Message uiMsg = new Message();
uiMsg.what = 0;
fragment.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(fragment.getContext(), "验证码已发送",
Toast.LENGTH_SHORT).show();
fragment.startVerCodeCountDown();
}
});
} else if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
//验证码正确
fragment.checkVerCode = true;
fragment.stopVerifyUIDialog();
fragment.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
fragment.fragmentResetPassword.setFindPhone(fragment.editPhone.getText().toString());
fragment.replaceFragment(fragment.fragmentResetPassword, fragment.SLIDE_FROM_RIGHT_TO_LEFT);
}
});
}
} else {
//出现异常
int status = 0;
fragment.stopVerifyUIDialog();
try{
((Throwable) data).printStackTrace();
Throwable throwable = (Throwable) data;
JSONObject object = new JSONObject(throwable.getMessage());
final String des = object.optString("detail");
status = object.optInt("status");
if (!TextUtils.isEmpty(des)) {
fragment.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(fragment.getContext(), des, Toast.LENGTH_SHORT).show();
}
});
}
} catch (Exception e) {
SMSLog.getInstance().w(e);
}
}
}
开发者ID:838030195,项目名称:DaiGo,代码行数:61,代码来源:FragmentVerifyPhone.java
示例16: handleMessage
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
@Override
public void handleMessage(Message msg) {
final ResetPhoneActivity activity = activityWeakReference.get();
int event = msg.arg1;
int result = msg.arg2;
Object data = msg.obj;
if (result == SMSSDK.RESULT_COMPLETE) {
//正确进行
if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
//获取验证码
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(activity, "验证码已发送",
Toast.LENGTH_SHORT).show();
activity.startVerCodeCountDown();
}
});
} else if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
//验证码正确
activity.checkVerCode = true;
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
activity.stopUIDialog();
}
});
//执行修改逻辑
if (activity.checkVerCode) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
//打开正在执行对话框
activity.startRegUIDialog();
String phoneNum = activity.nonspaceConvert(activity.ETNewPhone.getText().toString()); //手机号码
//开启网络请求
activity.updateUserOnServer(phoneNum);
}
});
}
}
} else {
//出现异常
int status = 0;
try{
((Throwable) data).printStackTrace();
Throwable throwable = (Throwable) data;
JSONObject object = new JSONObject(throwable.getMessage());
final String des = object.optString("detail");
status = object.optInt("status");
if (!TextUtils.isEmpty(des)) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
activity.stopUIDialog();
Toast.makeText(activity, des, Toast.LENGTH_SHORT).show();
}
});
}
} catch (Exception e) {
SMSLog.getInstance().w(e);
}
}
}
开发者ID:838030195,项目名称:DaiGo,代码行数:76,代码来源:ResetPhoneActivity.java
示例17: afterEvent
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
@Override
public void afterEvent(final int event, final int result, final Object data) {
runOnUiThread(new Runnable() {
@Override
public void run() {
//回调完成
if (result == SMSSDK.RESULT_COMPLETE) {
//返回支持发送验证码的国家列表
if (event == SMSSDK.EVENT_GET_SUPPORTED_COUNTRIES) {
// SMSSDK.getSupportedCountries();
onCountryListGot((ArrayList<HashMap<String, Object>>) data);
//获取验证码成功
} else if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
// 请求验证码后,跳转到验证码填写页面
afterVerificationCodeRequested((Boolean) data);
//提交验证码成功
} else if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
mEtCode.setText("");
RegOK();
}
} else {
// 根据服务器返回的网络错误,给toast提示
try {
((Throwable) data).printStackTrace();
Throwable throwable = (Throwable) data;
JSONObject object = new JSONObject(
throwable.getMessage());
String des = object.optString("detail");
if (!TextUtils.isEmpty(des)) {
ToastUtils.show(LoginActivity.this, des);
return;
}
} catch (Exception e) {
SMSLog.getInstance().w(e);
}
}
}
});
}
开发者ID:yiwent,项目名称:Mobike,代码行数:44,代码来源:LoginActivity.java
示例18: afterEvent
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
@Override
public void afterEvent(final int event, final int result,
final Object data) {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (result == SMSSDK.RESULT_COMPLETE) {
if (event == SMSSDK.EVENT_GET_SUPPORTED_COUNTRIES) {
onCountryListGot((ArrayList<HashMap<String, Object>>) data);
} else if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
// 请求验证码后,跳转到验证码填写页面
afterVerificationCodeRequested((Boolean) data);
} else if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
}
} else {
// 根据服务器返回的网络错误,给toast提示
try {
((Throwable) data).printStackTrace();
Throwable throwable = (Throwable) data;
JSONObject object = new JSONObject(
throwable.getMessage());
String des = object.optString("detail");
if (!TextUtils.isEmpty(des)) {
ToastUtils.show(RegActivity.this, des);
return;
}
} catch (Exception e) {
SMSLog.getInstance().w(e);
}
}
}
});
}
开发者ID:zzlnewair,项目名称:Myshop,代码行数:48,代码来源:RegActivity.java
示例19: afterEvent
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
@Override
public void afterEvent(final int event, final int result,
final Object data) {
runOnUiThread(new Runnable() {
@Override
public void run() {
if(dialog !=null && dialog.isShowing())
dialog.dismiss();
if (result == SMSSDK.RESULT_COMPLETE) {
if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
// HashMap<String,Object> phoneMap = (HashMap<String, Object>) data;
// String country = (String) phoneMap.get("country");
// String phone = (String) phoneMap.get("phone");
// ToastUtils.show(RegSecondActivity.this,"验证成功:"+phone+",country:"+country);
doReg();
dialog.setMessage("正在提交注册信息");
dialog.show();;
}
} else {
// 根据服务器返回的网络错误,给toast提示
try {
((Throwable) data).printStackTrace();
Throwable throwable = (Throwable) data;
JSONObject object = new JSONObject(
throwable.getMessage());
String des = object.optString("detail");
if (!TextUtils.isEmpty(des)) {
// ToastUtils.show(RegActivity.this, des);
return;
}
} catch (Exception e) {
SMSLog.getInstance().w(e);
}
}
}
});
}
开发者ID:zzlnewair,项目名称:Myshop,代码行数:53,代码来源:RegSecondActivity.java
示例20: afterEvent
import cn.smssdk.utils.SMSLog; //导入依赖的package包/类
@Override
public void afterEvent(final int event, final int result,
final Object data) {
runOnUiThread(() -> {
if (result == SMSSDK.RESULT_COMPLETE) {
if (event == SMSSDK.EVENT_GET_SUPPORTED_COUNTRIES) {
onCountryListGot((ArrayList<HashMap<String, Object>>) data);
} else if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
// 请求验证码后,跳转到验证码填写页面
afterVerificationCodeRequested((Boolean) data);
} else if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
}
} else {
// 根据服务器返回的网络错误,给toast提示
try {
((Throwable) data).printStackTrace();
Throwable throwable = (Throwable) data;
JSONObject object = new JSONObject(
throwable.getMessage());
String des = object.optString("detail");
if (!TextUtils.isEmpty(des)) {
Toast.makeText(RegisterActivity.this, des, Toast.LENGTH_SHORT).show();
//Log.d("RegisterActivity ", "dfasdf" + des);
mEtPhone.setText("");
mEtPassword.setText("");
mEtPhone.setFocusable(true);
mEtPassword.clearFocus();
CustomPrograss.disMiss();
//ToastUtils.show(RegActivity.this, des);
return;
}
} catch (Exception e) {
Log.d("RegisterActivity", "e:" + e);
SMSLog.getInstance().w(e);
CustomPrograss.disMiss();
}
}
});
}
开发者ID:wuyinlei,项目名称:TravelAround,代码行数:50,代码来源:RegisterActivity.java
注:本文中的cn.smssdk.utils.SMSLog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论