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 ...
随机推荐
- 用secureCRT操作ubuntu终端
用secureCRT操作ubuntu终端 ubuntu下先安装ssh windows下win+R再输入ubuntu的ip地址 ubuntu 检测端口号的命令 netstat -antp 下载到 ...
- 【转】C语言正确使用extern关键字
利用关键字extern,可以在一个文件中引用另一个文件中定义的变量或者函数,下面就结合具体的实例,分类说明一下. 一.引用同一个文件中的变量 #include<stdio.h> int f ...
- SIP 认证
理解SIP的认证 1. 认证和加密 认证(Authorization)的作用在于表明自己是谁,即向别人证明自己是谁.而相关的概念是MD5,用于认证安全.注意MD5仅仅是个hash函数而已,并不是 ...
- JavaScript中的事件冒泡?事件传播的解释
注:本文来源 可译网 事件冒泡是你在学习javaScript旅途中遇到的一个术语,它涉及到当一个元素被另一个元素嵌套时调用事件处理的顺序,并且两个元素注册了同一个事件(例如,点击事件). 但是事件冒 ...
- C++ code:指针类型(pointer types)
#include <iostream> using namespace std; int main() { float f = 34.5; int *ip = reinterpret_ca ...
- linux eclipse 报错过时的方法
重新配置jre库 https://jingyan.baidu.com/article/7f766daff5b8cd4101e1d0b4.html
- Tesseract环境搭建及编译安装
Tesseract环境搭建及编译安装 Tesseract源码都是C++源码:对于不咋会C++的人来说,这真是...虽然说语言有相通性,但是...哎!!!!! 分享出来,也希望对大家有所帮助. 环境:w ...
- python 全栈开发,Day127(app端内容播放,web端的玩具,app通过websocket远程遥控玩具播放内容,玩具管理页面)
昨日内容回顾 1. 小爬爬 内容采集 XMLY 的 儿童频道 requests 2. 登陆 注册 自动登陆 退出 mui.post("请求地址",{数据},function(){} ...
- python算法双指针问题:二分查找
这里要注意的是//向下取整,下次循环时,如果大于查找的数字,start+1. 并且,只能向下取整,如果向上取整. 那么,在比较第一个数时,start = 0 .end = 1.mid = 1.就会进入 ...
- [转] web无插件播放RTSP摄像机方案,拒绝插件,拥抱H5!
需求 问题:有没有flash播放RTSP的播放器?H5能不能支持RTSP播放? 答案:没见过,以后估计也不会有: 问题:可以自己做浏览器插件播放RTSP吗? 答案:可以的,chrome做ppapi插件 ...