如果主键标记时没有添加autoincrement,那么就是传的id重复了, 传的时候获取最新id然后++id即可 如果标记@Id(autoincrement = true),按理不用手动传id的,也确实没传,还报not unique的话,那么 GreenDao的主键必须设置成包装类 Long
使用strings.xml进行格式化占位符时报错: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute? 检
在使用RecyclerView时出现问题: java.lang.IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling 出错原因:非法状态异常,即当Re
TextView及布局Layout默认是没有press及focus状态的,故直接设置selector无作用,需要开启focus、press及focusInTouchMode textView.setClickable(true); textView.setFocusable(true); textV
子控件宽度无法填满父控件 android:fillViewport="true" 隐藏滚动条 android:scrollbars="none" 或 horizontalScrollView.setVerticalScrollBarEnabled(false
从FragmentPagerAdapter管理Fragment生命周期及可见性 使用ViewPager和Fragment相结合需要用到FragmentPagerAdapter适配器。那么我们先来看下FragmentPagerAdapter适配器带来的问题 问题1:如果Fragment有网络加载,那么
Android Studio 3.0开始使用api/implementation指令,弃用compile/provided,总的来说是为了加快构建编译速度。 Android Studio 2.X Android Studio 3.X apk runtimeOnly provided
Android library中生成的R.java中的资源ID不是常数 不能使用switch…case,解决方法: @Override public void onClick(View v) { int id = v.getId(); if (id == R.id.btn_log
apk组成结构 Android项目经过编译和打包生成普通的apk文件包含: classes.dex:.dex文件 resources.arsc:resources resources文件 AndroidManifest.xml:AndroidManifest.xml文件 res:uncompile
主页及最新Release:https://developer.android.google.cn/topic/libraries/support-library/packages Recent Support Library Revisions:https://developer.android.g
升级后compileSdkVersion为26,因为此时classpath 'com.android.tools.build:gradle:3.0.0',v4包的版本是27.0.0。 报KeyEventCompat类(项目中用到KeyEventCompat的hasNoModifi
腾讯Bugly 腾讯Bugly - 一种愉悦的开发方式是一款非常方便帮组开发者实时的检测App的异常及应用统计,还有更加强大的应用更新及热修复。 官网地址:https://bugly.qq.com Google Acra Google Acra是Google推出的开源Android应用Crash
临时配置 $ export PATH=$PATH:/data/ndk/android-ndk-r16b 当前用户配置 $ vim ~/.bashrc export ANDROID_NDK_HOME=/data/ndk/android-ndk-r16b export PATH=$PATH:$AND
C++类型转换 C++类型转换 static_cast 普遍情况 const_cast 去常量 dynamic_cast 子类类型转为父类类型 reinterpret_cast 函数指针转型,不具备移植性 static_cast 普遍情况 #include <iostream>
C++异常处理 //C++ 异常处理,根据抛出的异常数据类型,进入到相应的catch块中 void main() { try { int age = 300; if (age > 200) { throw 9.8;