2016年3月10日Android实习日记
待解决问题:
*1:内部ScrollView与外部手势事件滑动冲突问题。
*2:Linearlayout+View+LinearLayout横向排列,这其中两个LinearLayout内部各有3个竖向排列的TextView,这3个TextView的居中问题。
今天解决的问题:
1.
//
private static Handler handler = new Handler() {
public void handleMessage(android.os.Message msg) {
for (int i = 0; i < eList.getExaminationCount(); i++) {
Question question = new Question();
question.setAnswer(eList.getExamination(i).getTrueanswer());
... ...
question.setExplain(eList.getExamination(i).getExplain());
QuestionList.add(question);
}
};
};
//
public class ExamListRecv extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals("EXAMLIST")) {
handler.sendEmptyMessage(0);
}
}
}
激活BroadcastReceiver 为新的进程(包括线程),所以会向UI线程发送消息,更新UI。
2.同事的写法。Toast.makeText(getApplicationContext(), "已经连接", 200).show();
3.还没从数据库加载完成就执行自定义的init()操作导致出现InvocationTargetException异常和数组越界。
4.将工程从Eclipse转移到Android Studio上时,出现Execution failed for task 'app:mergeDebugResources' Crunching Cruncher…png failed错误,主要是图片问题,格式不对,把原来的图片用画图工具打开,然后重新另存为就好了。若出现Error:Execution failed for task ':ProjectName:mergeDebugResources'. > Crunching Cruncher *some file* failed, see logs。重启一下Android Studio就好了。重新运行,会提示签名不一样,会把原来的程序卸载掉,终于又回到了Android Studio这么爽的平台,加油。
可以再参考:在你的主工程文件夹里的build.gradle文件里,加上下面这两句:
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
参考:https://segmentfault.com/q/1010000002634455
5.protobuf工具学习使用。
6.在我们运用Android 官方新的Gradle构建方式build后的存在于app/build/apk文件夹下会发现有app-debug-unaligned.apk,那么这个apk是什么作用呢?
实际上分为两个过程,这个unaligend仅仅是个中间产物(intermediate product).
- 1.生成unaligned APK.
- 2.unaligned APK变为aligned,并且产生aligned APK.
参考:http://www.gimoo.net/t/1502/54ed73019d10b.html
解决的问题2:
- <LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="10dp"
android:gravity="center"
android:orientation="vertical">- <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="题友出错率"
android:textColor="@color/exam_small_size"
android:textSize="@dimen/exam_detail_tiyou_font_size" />- <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5.9%"
android:textColor="#FF0000"
android:textSize="40sp" />- <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="据统计5.9%的人做错过"
android:textColor="@color/exam_small_size"
android:textSize="@dimen/exam_detail_tiyou_font_size" />- </LinearLayout>
- <View
android:layout_width="1px"
android:layout_height="70dp"
android:layout_centerHorizontal="true"
android:background="#C4C4C4" />- <LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerHorizontal="true"
android:layout_marginRight="10dp"
android:gravity="center"
android:orientation="vertical">- <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="我的出错率"
android:textColor="@color/exam_small_size"
android:textSize="@dimen/exam_detail_tiyou_font_size" />- <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="100.0%"
android:textColor="#FF0000"
android:textSize="40sp" />- <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="我做错1次,做对0次"
android:textColor="@color/exam_small_size"
android:textSize="@dimen/exam_detail_tiyou_font_size" />
</LinearLayout>
2016年3月10日Android实习日记的更多相关文章
- 2016年3月15日Android实习日记
1.解决了ScrollView滑动冲突问题. 2.设置好了“查看详解”与“题目编号”的部分. 3.完成了app启动图片的设置,并在启动的过程中开辟新的线程连接服务器并开启监听数据. 别忘了注册启动Ac ...
- 2016年3月9日Android实习日记
1. 解决 org.eclipse.swt.SWTException: Graphic is disposed 问题. 参考:http://www.xuebuyuan.com/1896964.html ...
- 2016年3月11日Android实习日记
1.明天删除orthodotics_design_animation_content_gif.gif文件.(已完成) 2. 如何检测内存泄露? A: 可以通过一些性能监测分析工具,如 JProfile ...
- 2016年3月8日Android实习日记
1.出现fragment后台栈的bug. bug描述:当点击加入后台栈的操作按钮改变指定控件的内容之后,称为A操作:接下来又点击其它没有操作后台栈的按钮来修改原来指定的控件内容,称为B操作.然后点击b ...
- 2016年3月4日Android实习笔记
1.让水平LinearLayout中的两个子元素分别居左和居右 在LinearLayout中有两个子元素,LinearLayout的orientation是horizontal.需要让第一个元素居左, ...
- 2016年3月3日android实习笔记
1: android自定义控件时,通常需要重写父类构造函数.这三个够找函数具体啥时调用? public View (Context context) 是在java代码创建视图的时候被调用,如果是从xm ...
- 2016年3月1日Android实习笔记
1:经查资料,Android中gif动画加载共有两种 1)利用WebView,WebView 主要调用三个方法:LoadUrl.LoadData.LoadDataWithBaseURL 2)主要用的是 ...
- 2016年3月11日Android学习日记
1.调试技巧:当一次调试过后,可以在App重新返回当前的状态,然后再调试,而不用再点击Android studio的Debug按钮. 参考:http://www.2cto.com/kf/201506/ ...
- 2016年12月10日 星期六 --出埃及记 Exodus 21:5
2016年12月10日 星期六 --出埃及记 Exodus 21:5 "But if the servant declares, `I love my master and my wife ...
随机推荐
- python模块介绍- binascii:二进制和ASCII互转以及其他进制转换
20.1 binascii:二进制和ASCII互转作用:二进制和ASCII互相转换. Python版本:1.5及以后版本 binascii模块包含很多在二进制和ASCII编码的二进制表示转换的方法.通 ...
- 搭建RDA交叉编译器
apt-get install subversion //安装版本控制系统,便于管理文件目录 apt-get install make atp-get install gcc =======set e ...
- linux系统切换用户
无权限上传文件解决办法 1.当前登录的普通用户:user1/password1 2.切换到管理员(user2)用户: sudo su - user2 输入user2用户的密码:password2 或者 ...
- 转载:Linux操作系统(1.3.1)《深入理解Nginx》(陶辉)
原文:https://book.2cto.com/201304/19611.html 1.3 准备工作 由于Linux具有免费.使用广泛.商业支持越来越完善等特点,本书将主要针对Linux上运行的Ng ...
- 解决sdk更新时候报错 http://dl-ssl.google.com/android上不去,链接拒绝
解决国内访问Google服务器的困难: 启动 Android SDK Manager : 打开主界面,依次选择「Tools」.「Options...」,弹出『Android SDK Manager - ...
- SQL代码整理
--SQL代码整理: create database mingzi--创建数据库go--连接符(可省略)create table biao--创建表( lieming1 int not null,-- ...
- Java基础97 json插件的使用(java对象和json字符串对象之间的转换)
1.需要用到的包 2.实例 实体类 people package com.shore.entity; /** * @author DSHORE/2019-4-19 * */ public class ...
- 学习笔记(一)--->《Java 8编程官方参考教程(第9版).pdf》:第一章到六章学习笔记
注:本文声明事项. 本博文整理者:刘军 本博文出自于: <Java8 编程官方参考教程>一书 声明:1:转载请标注出处.本文不得作为商业活动.违者本人不负法律责任.违法者自负一切法律责任. ...
- hdu2838树状数组解逆序
离散化和排序后的序号问题搞得我实在是头痛 不过树状数组解逆序和偏序一类问题真的好用 更新:hdu的数据弱的真实,我交上去错的代价也对了.. 下面的代码是错的 /* 每个点的贡献度=权值*在这个点之前的 ...
- Windows安装Nginx
环境:Windows 10 Nginx :nginx-1.13.12 安装步骤: 1.下载Nginx 进入官方网站下载页面 https://nginx.org/en/download.html 可以看 ...