1.项目运行提示 编码GBK的不可映射字符
//在app下的build.gradle文件添加
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
2.ScrollView中嵌套RecycclerView导致数据显示不全问题。
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</ScrollView>
使用RelativeLayout,並添加android:descendantFocusability=”blocksDescens”
3.根据提示,缺少资源文件:packageName=com.umeng.soexample type=string name=umeng_socialize_male请去sdk下载包中拷贝umeng_socialize_male。
拷貝string/umeng_socialize_strings.xml文件
4.Android studio 编译出现
Error:Execution failed for task ‘:app:processDebugManifest’.
Manifest merger failed with multiple errors, see logss
这里问题是多个library中的AndroidMainfest.xml中icon和roundIcon引用不同,删除编译通过。
5.Android studio常量表达式的错误
int id = view.getId();
switch (id) {
case R.id.button1:
action1();
break;
case R.id.button2:
action2();
break;
case R.id.button3:
action3();
break;
}
快捷键为选中switch后,按alt+enter,选择replace为if..else