2013年8月29日

android:imeOptions

摘要: 转自:http://www.cnblogs.com/qiengo/archive/2012/05/03/2480857.html默认情况下软键盘右下角的按钮为“下一个”,点击会到下一个输入框,保持软键盘设置android:imeOptions="actionDone",软键盘下方变成“完成”,点击后光标保持在原来的输入框上,并且软键盘关闭android:imeOptions="actionSend"软键盘下方变成“发送”,点击后光标移动下一个在这里设置的imeOptions如何使用呢?如下面的代码,让EditText实现setOnEditorAction 阅读全文

posted @ 2013-08-29 16:23 leihupqrst 阅读(300) 评论(0) 推荐(0)

2013年8月23日

Android--多线程之Looper

摘要: 原文出处:http://www.cnblogs.com/plokmju/p/android_Looper.html之前看了很多关于Handler和Looper的文章,总感觉云里雾里,这篇文章讲的不错,简单明了。前言 上一篇博客讲解了Handler实现线程间通信,这篇博客讲解一下Handler运行的原理,其中涉及到MessageQueue、Looper。简要来讲,Handler会把一个线程消息发送给当前线程的消息队列,从最后Handler会处理消息队列中的消息,这里的消息队列就是MessageQueue,而管理消息队列的,就是Looper。 Handler、MessageQueue、Loop.. 阅读全文

posted @ 2013-08-23 09:39 leihupqrst 阅读(316) 评论(0) 推荐(0)

2013年8月20日

Android--多线程之AsyncTask

摘要: 前言 本片博客将介绍AsyncTask的使用,之前有介绍过线程和进程。而在AsyncTask中,运行在用户界面中,执行异步操作,并且把执行结果发布在UI线程上,且也不需要处理线程和Handler。在本篇博客里,将会讲解到AsyncTask的基本介绍,以及如何使用,最后会以一个简单的Demo讲解AsyncTask的使用。AsyncTask AsyncTask,异步任务,可以简单进行异步操作,并把执行结果发布到UI主线程。AsyncTask是一个抽象类,它的内部其实也是结合了Thread和Handler来实现异步线程操作,但是它形成了一个通用线程框架,更清晰简单。AsyncTask应该被用于比.. 阅读全文

posted @ 2013-08-20 10:38 leihupqrst 阅读(292) 评论(0) 推荐(0)

C++中的简单继承

摘要: Father.cpp: 1 #include 2 using namespace std; 3 class Father 4 { 5 protected: 6 int width; 7 int height; 8 public: 9 void setWidth(int widths)10 {11 width = widths;12 }13 void setHeight(int heights)14 {15 height = heights;16 }17 };18 19 class Son : pub... 阅读全文

posted @ 2013-08-20 10:19 leihupqrst 阅读(211) 评论(0) 推荐(0)

2013年8月13日

android中的简单animation(四)3D transition

摘要: animation_main_screen.xml: 1 2 6 7 13 14 20 21 layout_bottom_to_top.xml:1 xml version="1.0" encoding="utf-8"?>2 slide_right.xml:1 2 4 8 Transition3d.java: 1 package com.example.android.apis.animation; 2 3 import com.example.android.apis.R; 4 5 import android.app.Activity; 6 im 阅读全文

posted @ 2013-08-13 11:26 leihupqrst 阅读(386) 评论(0) 推荐(0)

android中的简单animation(三)accelerate(加速),decelerate(减速),anticipate,overshoot,bounce

摘要: animation_3.xml: 1 2 8 9 15 16 22 23 27 28 Animation3.java: 1 package com.example.android.apis.view; 2 3 import com.example.android.apis.R; 4 5 import android.app.Activity; 6 import android.os.Bundle; 7 import android.view.View; 8 import android.view.animation.AnimationUtils; 9 impo... 阅读全文

posted @ 2013-08-13 10:30 leihupqrst 阅读(1029) 评论(0) 推荐(0)

android中的简单animation(二)push up,push left,cross fade,hyperspace

摘要: animation_2.xml: 1 2 7 8 13 19 25 31 37 38 39 45 46 50 51 View Code push_up_in.xml(100%p表示相对于父控件100%):1 2 3 4 5 push_up_out.xml:1 2 3 4 5 push_left_in.xml:1 2 3 4 5 push_left_out.xml:1 2 3 ... 阅读全文

posted @ 2013-08-13 09:59 leihupqrst 阅读(681) 评论(0) 推荐(0)

2013年8月12日

android中的简单animation(一)shake

摘要: 1.shakeanimation_1.xml: shake.xml:(interpolator表示内插程序)cycle_7.xml:(cycles循环次数)Animation1.java:import com.example.android.apis.R;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.animation.Animation;import android.view.animation.AnimationUtils;p... 阅读全文

posted @ 2013-08-12 17:15 leihupqrst 阅读(753) 评论(0) 推荐(0)

2013年8月9日

在命令提示符中运行install adb 包名.apk文件 遇到的问题

摘要: 昨天更新了SDK以后遇到一个奇怪的问题,使用eclipse直接运行程序到手机没有问题,但是如果将程序打包之后在命令提示符中执行adb install 包名.apk就会报错:adb server is out of date.killing... ADB server didn't ACK * failed to start daemon *...以前一般关闭调试功能然后再打开,重启手机或者eclipse,甚至重启电脑之后问题就能解决,这次却怎么也不能成功,相当沮丧。网上有许多解决办法,尝试了几个以后就懒得再去尝试了,到新浪的历史专栏看了一天的历史--昨天晚上想了一下,觉得太不应该了,就 阅读全文

posted @ 2013-08-09 09:54 leihupqrst 阅读(860) 评论(0) 推荐(0)

2013年8月7日

Android 四种加载方式详解(standard singleTop singleTask singleInstance) .

摘要: Android之四种加载方式(http://marshal.easymorse.com/archives/2950 图片)在多Activity开发中,有可能是自己应用之间的Activity跳转,或者夹带其他应用的可复用Activity。可能会希望跳转到原来某个Activity实例,而不是产生大量重复的Activity。这需要为Activity配置特定的加载模式,而不是使用默认的加载模式。加载模式分类及在哪里配置Activity有四种加载模式:standardsingleTopsingleTasksingleInstance设置的位置在AndroidManifest.xml文件中activity 阅读全文

posted @ 2013-08-07 10:00 leihupqrst 阅读(437) 评论(0) 推荐(0)

导航