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 ...
随机推荐
- 深入解析内存原理:RAM的基本原理
1. 寻址原理概述RAM 主要的作用就是存储代码和数据供CPU 在需要的时候调用.但是这些数据并不是像用袋子盛米那么简单,更像是图书馆中用有格子的书架存放书籍一样,不但要放进去还要能够在需要的时候准确 ...
- mongodb数据库集群及sharding分片配置
复制集群的配置 1.安装mongodb数据库 在主节点和从节点上都安装mongodb # rpm -ivh mongo-10gen-2.4.6-mongodb_1.x86_64.rpm mongo-1 ...
- ubuntu系统初始化网络及mysql配置
安装系统时需要安装open-ssh服务软件,否则无法远程连接 1.修改root密码 # sudo passwd 输入密码即可 切换到root用户,需要输入刚才的root密码 # su - 2.配置网络 ...
- lvs基本概念、调度方法、ipvsadm命令及nat模型示例
LVS类型: NAT:-->(DNAT) DR TUN FULLNAT LVS的常见名词解释 CIP<-->VIP--DIP<-->RIP Direct Routing: ...
- MyEclipse中如何配置默认jsp为UTF-8格式
- 最新 macOS Sierra 10.12.3 安装CocoaPods及使用详解
一.什么是CocoaPods 每种语言发展到一个阶段,就会出现相应的依赖管理工具,例如 Java 语言的 Maven,nodejs 的 npm.随着 iOS 开发者的增多,业界也出现了为 iOS 程序 ...
- spring事物回滚遇到的问题
在service层使用声明式事务添加@Transactional(rollbackFor = Exception.class)注解 多个方法进行数据库操作,执行失败则隐式的回滚事务,但是已经成功的发方 ...
- notepad++ 快捷键大全、notepad常用快捷键
Notepad++ 快捷键 大全, notepad++也情有独钟,最近发现了一个快捷键,就是选中单词,ctrl+shift+enter.不过现在想知道一个快捷键,假设有三行代码,选中后一般按TAB就可 ...
- SeaJS入门教程系列之SeaJS介绍(一)
前言SeaJS是一个遵循CommonJS规范的JavaScript模块加载框架,可以实现JavaScript的模块化开发及加载机制.与jQuery等JavaScript框架不同,SeaJS不会扩展封装 ...
- 【linux】centos6.9安装gearman
1.确认yum源没问题,如果有问题,参照这里更换 2. yum install -y boost-devel gperf libevent-devel libuuid-devel yum instal ...