随笔分类 - Android
摘要:public class MyApplication extends Application { public static MyApplication INSTANCE; @Override public void onCreate() { super.onCreate(); INSTANCE =
阅读全文
摘要:方法一 Intent intent = new Intent(A.this,B.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent
阅读全文
摘要:当使用拦截器获取Response.body.string()后,后面的操作就直接返回Failed了,是因为流只能被使用一次的原因,破解如下 灵感HttpLoggingInterceptor public final class HttpLoggingInterceptor implements In
阅读全文
摘要:线程 new Thread(new Runnable() { public void run() { //sleep设置的是时长 Thread.sleep(1000); handler.sendMessage(); } }).start 延时器 TimerTask task = new TimerT
阅读全文
摘要:/** * 第一种加载证书 */ try { HttpsUtils.SSLParams sslParams = HttpsUtils.getSslSocketFactory(getAssets().open("wallet.cer")); OkHttpClient builder = new OkH
阅读全文
摘要:edit_bg.xml <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" xmlns:Android="http://schema
阅读全文
摘要:loading_bg.png dialog_loading.xml <?xml version="1.0" encoding="utf-8"?> <animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" a
阅读全文
摘要:public class DeviceUtil { /** * 是否有网 * @param context * @return */ public static boolean isNetworkConnected(Context context) { if (context != null) {
阅读全文
摘要:public class DeviceMacUtil { /** * Android 6.0 之前(不包括6.0) * 必须的权限 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> * @param con
阅读全文
摘要:public class RegexUtils { /** * 验证Email * @param email email地址,格式:zhangsan@sina.com,zhangsan@xxx.com.cn,xxx代表邮件服务商 * @return 验证成功返回true,验证失败返回false */
阅读全文
摘要:ViewUtils public class ViewUtils { /** * @Author AlanMa * @Description 处理图形大小 * @Date 2020/4/14 * @Param [editTextList] * @return void */ public stati
阅读全文
摘要:CountDownTimerUtils public class CountDownTimerUtils extends CountDownTimer { private TextView mTextView; public CountDownTimerUtils(TextView textView
阅读全文
摘要:EditTextUtils public class EditTextUtils { /** * 设置edittext只能输入小数点后两位 */ public static void afterDotOne(final EditText editText) { editText.addTextCha
阅读全文
摘要:项目中有这种需求,google了下发现了解决方案,摘录如下方便大家排查. 原文链接 原理是利用selector 第一步 在drawable文件夹下建立文件 tab_background.xml <?xml version="1.0" encoding="utf-8"?> <selector xmln
阅读全文
摘要:if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PERMISSION_GRANTED) {//判断是否已经赋予权限 if (ActivityCompat.should
阅读全文
摘要:
阅读全文
摘要:
阅读全文

浙公网安备 33010602011771号