自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(35)
  • 资源 (13)
  • 收藏
  • 关注

转载 绑定远程服务的流程aidl

--------绑定远程服务的流程aidl--------1.在Activity调用bindService()去绑定服务。bindService(intent, new MyConn(), BIND_AUTO_CREATE);需要传递一个叫ServiceConntion的接口参数用来返回两个回调,当服务被成功绑定,当服务失去连接。2在服务里面,需要重写onBind(

2015-07-27 18:28:05 455

原创 Android Studio里面新建aidl出现的问题

在工程的src/main右键,新建aidl文件系统会自动将其建立到src/main/aidl/xxx(包名)然后你发现咋不生成对应的java文件呢?其实只需要rebuild工程就可以了。注意:(1)aidl文件建立;(2)rebuild的工程。

2015-07-27 18:20:47 835

原创 build.gradle Failed to resolve:me.relex:circleindicator:1.1.5

在build.gradle文件中compile 'me.relex:circleindicator:1.1.5@aar'build.gradle Failed to resolve:me.relex:circleindicator:1.1.5出现这个错误。(1)查看自己的build.gradle文件和库的build.gradle文件compileSdkVersion

2015-07-16 23:12:19 3381 2

转载 如何在managedQuery()和getContentResolver().query()方法中实现结果去重

有时候,我们需要对查询的数据库结果进行去重。在SQL中我们可以通过distinct关键字实现,但是当我们使用android提供的managedQuery()或getContentResolver().query()方法对数据库进行查询时,并不能使用distinct关键字。那么,如何解决呢?首先,让我们来了解一下android中query方法吧。  当我们调用android系统的qu

2015-07-15 15:37:34 651

转载 Android利用ContentResolver查询的三种方式

今天做到一个小项目,查询手机中短信的信息,当让得去系统暴露出来的数据库中去查询了,后来发现有三种方式可以选择,下面一一写出来。  第一种方式,采用 getContentResolver().query()方法在主线程中查询数据。这种查询方式是不是异步查询的,直接在UI线程中查询数据,代码如下: Java代码  Cursor cursor1 = g

2015-07-15 15:33:37 1467

转载 初学Android,监控ContentProvider的数据改变(五十七)

有时候应用中需要监听ContentProvider的改变并提供响应,这时候就要利用ContentObserver类了不管是ContentProvider中实现的,insert,delete,update方法中的任何一个,程序都会调用getContext().getContentResolver().notifyChange(uri,null);这行代码可用于通知所有注册在该Uri上

2015-07-15 15:28:36 338

原创 AlertDialog里面有EditText,希望弹出对话框的时候弹出软键盘

代码如下:记住要在对话框show()方法调用之后,调用如下代码:public static void popSoftkeyboardInAlertDialog(Context ctx, EditText editText) { editText.requestFocus(); InputMethodManager imm = (InputMethodMana

2015-07-14 21:30:44 828

原创 AlertDialog在Api<17调用onDismissListener()方法

直接上代码:private void showDialog() { LayoutInflater inflater = LayoutInflater.from(this); View view = inflater.inflate(R.layout.dialog_red_packet_not_enough, null); TextView tv_

2015-07-14 21:25:19 2218

转载 Android进阶之AlertDialog自定义

AlertDialog的自定义方式有很多种,这里介绍两种。第一种是比较简单的,只自定义内容。在AlertDialog使用详解中,非常详细的介绍了以下六种使用方法。一、简单的AlertDialog(只显示一段简单的信息,比如about us)二、带按钮的AlertDialog(显示提示信息,让用户操作,比如exit时的警告框)三、类似ListView的AlertDialo

2015-07-14 14:06:04 557

转载 AlertDialog.Builder弹出自定义Layout窗口

------------------------------------------------------------------------------------------------------       此文章仅作为学习交流所用       转载或引用请务必注明原文地址:       http://blog.csdn.net/luzhenrong45/arti

2015-07-14 14:04:51 717

原创 DialogFragment里面设置setStyle()方法,动画效果失效

在DialogFragment里面的onStart()方法设置了,setStyle()了之后,发现里面的动画效果不起作用了。 @color/white false @color/transparent @anim/push_bottom_in @anim/push_bottom_out 在@Overri

2015-07-14 09:46:09 4599

原创 android的DialogFragment设置全屏之后,里面的View不能充满整个屏幕

将DialogFragment全屏之后,里面View的布局类似是这样子的。<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"

2015-07-14 09:38:07 2572

原创 android自定义PopupWindow,不显示内容

public class PopWindow extends PopupWindow { private Context mContext; private View mPopView; private OnAnimationDismissListener mOnAnimationDismissListener; public PopWindow(Context context, Vie

2015-07-12 15:12:33 3280

原创 android在PopupWindow里面,AnimationListener的AnimationEnd()方法调用dismiss(),出现错误

EXCEPTION: main03-20 11:31:59.207: E/AndroidRuntime(20030): java.lang.NullPointerException03-20 11:31:59.207: E/AndroidRuntime(20030): at android.view.ViewRootImpl.drawAccessibilityFocusedDrawabl

2015-07-12 15:08:56 1881

转载 scheduleAtFixedRate 与 scheduleWithFixedDelay 的区别

package thread;import java.util.concurrent.Executors;import java.util.concurrent.ScheduledExecutorService;import java.util.concurrent.ScheduledFuture;import java.util.concurrent.ThreadFactory;im

2015-07-09 22:04:21 1105

原创 android自定义控件之extends某控件时,不同构造方法的调用情况分析。

public CountDownButton(Context context) { // 方法一 super(context); Log.e("CountDownButton", "CountDownButton(Context context)"); } public CountDownButton(Context context, AttributeSet attrs) { //

2015-07-09 21:49:02 1084

原创 Android调用invalidate(),控件不进行重绘画

情形自己想定义一个倒计时的TextView控件,开启定时任务,1s钟更新一次,将新的值,重绘上去。这里自己是在线程里面调用的invalidate(),第一次重绘成功之后,后面就不执行线程了,线程里面的语句也不打印。其实在线程中需要重绘控件的话,应该调用postinvalidate()函数。

2015-07-09 19:20:44 4204 1

原创 AndroidStudio使用本地aar包

在主工程中,AndroidStudio菜单栏File->New Module->Phone and Tablet Application->Import .JAR or .AAR Package,然后将circleimageview.aar加入即可。在主工程中的build.gradle中加入需要编译的工程(红色部分的代码)apply plugin: 'com.android.appli

2015-07-09 15:02:31 472

原创 AndroidStudio生成aar包

AndroidStudio本身会将module生成aar包,http://stackoverflow.com/questions/24309950/create-aar-file-in-android-studiorobotdeMacBook-Pro:aar robot$ pwd/Users/robotke/Downloads/TestAndroid/circleimageview/

2015-07-09 14:53:42 1254 1

原创 Android Studio将module打包成.jar包

上一篇博客已经将circleimageview源码libary成功引入到了项目工程中。这里将这个module打包成jar文件。其实只需要在build.gradle文件中,加入红色部分的文字即可。apply plugin: 'com.android.library'android { compileSdkVersion 22 buildToolsVersion '21

2015-07-09 14:11:10 5422 2

原创 AndroidStudio导入libary源码

这篇文章写的不错,android studio 使用心得(七)---如何导入library工程包自己尝试按照上面写的方法导入https://github.com/hdodenhof/CircleImageView遇到如下错误,Error:No such property: GROUP for class: org.gradle.api.publication.maven.i

2015-07-09 13:49:27 666

原创 adapter.notifyDataSetChanged()不起作用

ArrayAdapter adapter;private List list = new ArrayList();// ...... list.add("1"); list.add("1"); list.add("1"); list.add("1"); list.add("1"); list.add

2015-07-09 10:58:04 985

原创 Activity调用dispatchTouchEvent()和onTouchEvent()方法

public class MyTextView extends TextView { public MyTextView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } public MyTextView(Context context, At

2015-07-08 15:30:39 3766

转载 android动画中fillBefore以及fillAfter在xml中设置无效的问题

fillBefore是指动画结束时画面停留在第一帧,fillAfter是指动画结束是画面停留在最后一帧。最关键的问题是,这2个参数不能在xml中设置,这是没有用的。必须在java代码中设置。比如setFillAfter(true);  setFillBefore(false);这样动画结束时,停在最后一帧。//----------------------------

2015-07-07 23:48:07 2593

转载 Activity的四种启动模式和onNewIntent()

Android中Activity启动模式详解  在Android中每个界面都是一个Activity,切换界面操作其实是多个不同Activity之间的实例化操作。在Android中Activity的启动模式决定了Activity的启动运行方式。  Android总Activity的启动模式分为四种:Activity启动模式设置: ".Ma

2015-07-07 12:02:59 462

转载 Android的Animation之LayoutAnimation使用方法

LayoutAnimationController用于为一个layout里面的控件,或者是一个ViewGroup里面的控件设置动画效果,可以在XML文件中设置,亦可以在Java代码中设置。一种直接在XML文件中设置1.  在res/anim文件夹下新建一个XML文件,名为list_anim_layout.xml,[java] view plaincopy

2015-07-06 22:15:11 565

转载 android listview每个item定义动画呈现

LayoutAnimationsController1、什么是LayoutAnimationsControllerLayoutAnimationsController可以用于实现使多个控件按顺序一个一个的显示。1)LayoutAnimationsController用于为一个layout里面的控件,或者是一个ViewGroup里面的控件设置统一的动画效果。2)每一个

2015-07-06 22:07:40 672

原创 android软键盘现实和隐藏的监听

http://stackoverflow.com/questions/4312319/howto-capture-the-virtual-keyboard-show-hide-event-in-androidhttp://stackoverflow.com/questions/2150078/how-to-check-visibility-of-software-keyboard-in

2015-07-03 14:37:50 702

原创 Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or pat

Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x1010059 a=-1}发生这个错误,最近本的解决办法我就不说了哈。比较新颖的原因:由于手贱将图片资源拷贝到了drawable-

2015-07-02 20:12:40 2265

转载 android屏蔽软键盘并且显示光标

如果是android4.0以下,那么[java] view plaincopyeditText.setInputType(InputType.TYPE_NULL);  就够了,android4.0以上屏蔽软键盘并且有光标,需要用到。[java] view plaincopyif 

2015-07-02 10:44:54 510

原创 DialogFragment设置自定义动画

getDialog().getWindow().getAttributes().windowAnimations = R.style.CustomDialog; @android:color/white false @android:color/transparent @anim/push_bottom_in

2015-07-01 16:32:54 4206

原创 DialogFragment如何设置大小和位置

getDialog().getWindow().setGravity(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM); WindowManager.LayoutParams lp = getDialog().getWindow().getAttributes(); lp.width = WindowManager.Layout

2015-07-01 16:12:58 6505

转载 DialogFragment弹出后Activity背景不变暗

(1):在style 的xml 里 设置如下            false    设置为true, 背景变暗Dialog = new Dialog(Activity, R.style.dialog); (2):在代码中 可以这么设置Window mWindow = getWindow();                  Win

2015-07-01 16:10:06 6129 2

原创 No view found for id 0x7f080005 (id/view_pager) for fragment

情形:在popupwindow里面放入了ViewPager,出现伤处的错误。参考了一下http://blog.csdn.net/Droid_zhlu/article/details/22269103http://stackoverflow.com/questions/19544829/viewpager-with-fragments-inside-popupwindow-or-di

2015-07-01 13:59:16 2225

转载 android - anim translate中 fromXDelta、toXDelta、fromYDelta、toXDelta属性

<translate android:fromXDelta="0" android:toXDelta="100%" android:duration="300"/> <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="300" />

2015-07-01 09:39:18 443

dagger2依赖分析的代码

dagger2依赖分析的代码

2016-06-03

ShowPercentView

android自定义View之(六)------高仿华为荣耀3C的圆形刻度比例图(ShowPercentView),详细参考:http://blog.csdn.net/hfreeman2008/article/details/43369961 加入了注释进行了简单的封装,感谢原作者

2015-02-02

EventBusDemo

里面有eventbus的解耦使用,修改别人的例子,加上注释;也加上了roboguice的简单实用。eventbus的使用参考http://blog.csdn.net/knighttools/article/details/26608351

2014-08-04

android acra将错误日志发送到邮箱

这个使用android的开源acra将错误日志发送到邮箱中。可以成功运行,将日志发送到邮箱中。

2014-07-23

Activity切换,上入下出,防止背景黑屏

Activity切换,上入下出,防止背景黑屏

2014-06-26

base64编解码

base64进行编解码,比如可以在SMTP中使用

2013-05-18

使用telnet协议来收发邮件(SMTP和POP3)

通过这个实验对SMTP和POP3有一定了解

2013-05-18

Ubantu 虚拟机安装

详细的介绍了Ubantu的安装,按照步骤一步步的安装。

2013-05-09

Encode_+Decode+Tools+URL编码解码工具

Encode_+Decode+Tools+URL编码解码工具,非常使用的工具。

2013-04-26

网络物理接口V.24

介绍了网络接口V.24的原理和使用,其物理特性等等。可以对比接口V.35等进行学习。

2013-04-26

精通LinuxC编程源代码

精通LinuxC编程源代码,其中有相关的Linux下C的实战项目。

2012-10-19

Linux C程序设计大全源代码

Linux C程序设计大全源代码,其中有Linux下C的实战项目。

2012-10-19

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除