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 ...
随机推荐
- mac安装pyspider报错
(env)$ pip3 uninstall pycurl (env)$ pip3 install --upgrade pip (env)$ export LDFLAGS=-L/usr/local/op ...
- 织梦dedeCMS数据库结构字段说明-简略说明
dede_addonarticle 附加文章表 aid int(11) 文章编号typeid int(11) 分类栏目编号body mediumtext 文章内容dede_addonflash 附加F ...
- 下载文件的一致性验证之MD5值校验
前几天写脚本遇到下载功能校验,一时间不到怎么校验好? 于是请教大神,大神给出方案如下: 先去了解一下你们的产品针对这个下载功能有没有做什么功能设计...然后再针对这些功能设计去设计测试用例...比如 ...
- jmeter之ip欺骗
说明:我看有的博客说官方文档是在jmeter2.5以上的版本有此功能的实现~ 我的是2.13版本,也可以实现 . 准备工作: 使用IP欺骗功能必须得本地有多个可用IP,通常普通的PC机只有一个物理网卡 ...
- Mac安装Homebrew记录
在终端输入: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install) ...
- impress.js
介绍一下 impress.js是一个非常炫酷的幻灯片展示框架,依靠CSS3技术. impress.js使用起来非常简单,下面就来简单介绍一下其用法. Start 首先,当然要引入impress.js. ...
- poj2018 二分+线性dp好题
/* 遇到求最值,且答案显然具有单调性,即可用二分答案进行判定 那么本题要求最大的平均数,就可以转换成是否存在一个平均数为mid的段 */ #include<iostream> #incl ...
- poj1177 矩形周长并
线段树扫描线的模板题,一个月前写的发现忘了一些还是要看看以前的博客呀! /* 思路:数据小不用离散化处理,线段树叶子结点维护一个区间 */ #include<iostream> #incl ...
- 【转】ssh服务器启动和客户端常用操作
前言 简单的来说,SSH 是 Secure SHell protocol 的简写 (安全的壳程序协议),它可以透过数据封包加密技术,将等待传输的封包加密后再传输到网络上, 因此,数据讯息当然就比较安全 ...
- Oracle学习笔记--第2章 oracle 数据库体系结构
第2章 oracle 数据库体系结构 目录: ————————————— 2.1物理存储结构 2.1.1数据文件 2.2.2控制文件 2.1.3重做日志文件 2.1.4其他文件 2.2逻辑存储结构 2 ...