共 6 篇文章 |
|
14行:通过Looper.myLooper()获取了当前线程保存的Looper实例,然后在19行又获取了这个Looper实例中保存的MessageQueue(消息队列),这样就保证了handler的实例与我们Looper实例中MessageQueue关联上了。enqueueMessage中首先为meg.target赋值为this,【如果大家还记得Looper的loop方法会取出每个msg然后交给msg,target.dispatchMessage(msg)... 阅23 转0 评0 公众公开 18-10-04 21:17 |
Android之Handler用法总结。Handler handler = new Handler(){ public void handleMessage(Message msg) { switch (msg.what) { case 1: setTitle("hear me?");Message 在Android是什么呢? 对于Android中Handler可以传递一些内容,通过Bundle对象可以封装String、Integer以及Blob二进制对象,我们通过在线程中使用Handler对象的s... 阅4 转0 评0 公众公开 18-10-04 20:58 |
Android样式的开发:selector篇。><selector xmlns:android="http://schemas.android.com/apk/res/android"> <!<Button android:id="@+id/btn_default" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="8dp" android:back... 阅57 转0 评0 公众公开 18-10-04 11:13 |
Android中的Drawable基础与自定义Drawable.><transition xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/transition_drawable" android:drawable="@drawable/ic_launcher" android:top="10dp" //四周的偏移量 android:bottom="10dp" and... 阅521 转0 评0 公众公开 18-10-04 10:40 |
1.初次运行Android Studio时,会遇到“Fetching Android SDK component information”对话框去获取Android SDK组件的信息。关于第一个问题,最好的解决办法就是不去获取Android SDK组件的信息,因此我们就需要修改自己安装目录(作者安装路径为C:\Program Files\Android\Android Studio\bin)下的“idea.properties”文件内容,使用文本编辑器... 阅46 转0 评0 公众公开 18-09-30 23:52 |