修复as热启动崩溃问题

This commit is contained in:
AriaLyy
2017-06-17 14:31:26 +08:00
parent 66f4a7e6ba
commit cd964d600e
6 changed files with 7 additions and 7 deletions

View File

@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion '25.0.2'
buildToolsVersion '25.0.3'
defaultConfig {
minSdkVersion 9

View File

@ -161,8 +161,7 @@ public class DbEntity {
List<String> values = new ArrayList<>();
for (Field field : fields) {
field.setAccessible(true);
Ignore ignore = field.getAnnotation(Ignore.class);
if (ignore != null && ignore.value()) {
if (SqlHelper.ignoreField(field)) {
continue;
}
where.add(field.getName());

View File

@ -511,7 +511,7 @@ final class SqlHelper extends SQLiteOpenHelper {
* @return true 忽略该字段
*/
static boolean ignoreField(Field field) {
// field.isSynthetic(), 使用as热启动App时AS会自动给你的clss添加change字段
// field.isSynthetic(), 使用as热启动App时AS会自动给你的class添加change字段
Ignore ignore = field.getAnnotation(Ignore.class);
int modifiers = field.getModifiers();
return (ignore != null && ignore.value())