Android报错
奔跑的苍狼
一生中最幸运的两件事:一件,是时间终于将我对你的爱消耗殆尽。一件,是很久以前一天,我遇见了你。
展开
-
【Android】AS报错解决方法:Non-static method '*' cannot be referenced from a static context
【错误】Non-static method '*' cannot be referenced from a static context【翻译】在静态上下文中不能引用非静态方法'*'【造成原因】直接调用了其他包内的非静态方法。【举例】包 com.test.package1 中有类 TestMethod,该类中有非静态方法 test()。package com.test.Package1;pub...原创 2018-05-01 14:45:48 · 70844 阅读 · 3 评论 -
【Android】AS警告解决方法:String literal in setText can not be translated. Use Android resources instead.
【错误】String literal in setText can not be translated. Use Android resources instead.【翻译】在setText方法中的字符串文字不能被转换。使用Android资源代替之。【造成原因】在TextView对象引用setText方法时,直接传入字符串。【举例】 TextView textView = new T...原创 2018-05-02 15:36:06 · 6406 阅读 · 0 评论 -
【Android】AS警告:Do not concatenate text displayed with setText. Use resource string with placeholders.
【错误】Do not concatenate text displayed with setText. Use resource string with placeholders.【翻译】不要在setText方法中显示地连接字符串。使用带占位符的资源字符串。【造成原因】在TextView对象引用setText方法时,传入的是自己连接的字符串。【举例】字符串资源(strings.xml):<r...原创 2018-05-02 16:29:45 · 7317 阅读 · 1 评论 -
【Android】AS报错:Configuration on demand is not supported by the current version of the Android Gradle
【错误】Configuration on demand is not supported by the current version of the Android Gradle plugin since you are using Gradle version 4.6 or above. Suggestion: disable configuration on demand by setting...原创 2018-05-06 21:29:36 · 13043 阅读 · 1 评论