-
处理hideSoftInputFromWindow失效问题
作者: 陆金龙 发表时间: 2018-07-10 23:42软键盘显示时参数: public static final int SHOW_FORCED = 0x0002; 非强制不收起。此参数导致hideSoftInputFromWindow失效 修改方式: 显示软键盘时,将SHOW_FORCED 替换为SHOW_IMPLICIT隐式请求软键盘。 imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT); -
配置并行编译解决Gradle编译慢
作者: 陆金龙 发表时间: 2018-07-10 23:381.gradle.proerties 文件 org.gradle.jvmargs=-Xmx2048m org.gradle.parallel=true org.gradle.configureondemand=true 2.settings ->Build ->Compile 勾选 compile independent modules in parallel 3.settings ->Build ->Gradle 勾选 Offlinework -
isFinishing()处理 Unable to add window
作者: 陆金龙 发表时间: 2018-07-10 23:25先调用activity的isFinishing方法判断一下 以下代码的场景:蓝牙连接或断开时调用,但是Activity退出时,断开蓝牙也会回调,这是执行window.clearFlags会异常。 解决办法是先判断isFinishing,false的情况再执行。 override fun onBleConnectChanged(isConnected: Boolean) { if (!isFinishing) { &nbs... -
android 唤醒屏幕
作者: 陆金龙 发表时间: 2018-07-10 23:14getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); -
Android中常用的设计模式
作者: 陆金龙 发表时间: 2018-07-10 08:191.单例模式 private volatile static ImageLoader instance; public static ImageLoader getInstance() { if (instance == null) { synchronized (ImageLoader.class) { if (instance == null) { instance = new ImageLoader(); } } } return instance; } private stat... -
Intent.ACTION_VIEW打开文件报错处理
作者: 陆金龙 发表时间: 2018-07-10 08:04Intent intent = new Intent(); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setAction(Intent.ACTION_VIEW); String type = getMIMEType(file); // intent.setDataAndType(QhFileProviderUtils.GetUriForFileByFileProvider(context, file), type); // 某些应用无法理解一个指向文件的conten... -
魅族魅蓝3(m3) Android5.1使用tint属性运行报错
作者: 陆金龙 发表时间: 2018-06-12 02:06android:backgroundTint="@color/colorPrimary" android:tint="@android:color/white" 魅族魅蓝3(m3) Android5.1 使用了以上两个属性,运行报错。去掉后ok了。 <android.support.design.widget.FloatingActionButton a... -
Android 调试的环境问题
作者: 陆金龙 发表时间: 2018-06-09 17:33魅族手机安装,提示安装失败,更新包不兼容 解决方法如下: 设置->指纹和安全->访客模式,清除访客数据,即可。 或者(锁屏, 输入访客密码,进入访客模式 ,删除里面对应的App。 1.Android USB调试不能安装apk遇到的一个坑 INSTALL_FAILED_USER_RESTRICTED 用户拒绝了USB安装,关闭usb安装管理 魅族手机:手机管家–权限管理–USB安装管理–关闭USB安装管理 小米手机:开发者选项—打开USB安装(允许通过USB安装应用)&nb...