04 2015 档案
摘要:RecyclerView,是在v7包加入的,一个灵活的view可以展示巨大的数据集,类似于listview的viewholder复用已经优化好了。语言是苍白的,代码是最生动的叙说:布局: adapter:package com.escorps.retrodagger.adapter...
阅读全文
摘要:在输入框中输入我们想要输入的信息就会出现其他与其相关的提示信息,这种效果在Android中是用AutoCompleteTextView实现的。public class MainActivity extends Activity {private AutoCompleteTextView autote...
阅读全文
摘要:The Use CaseIn Fragment, there are a couple of places where we use horizontal scrollers as a selection view. This means that the center icon is the “s...
阅读全文
摘要:第一步:1. Create the variant dependent strings in your build scriptEdit yourbuild.gradlefile accordingly: //This line allows parameterization via the ter...
阅读全文
摘要:将数据从服务器端同步到手机上, 并且需要离线工作,Couchebase Mobile 也许是目前最好的解决方案:原文地址:https://www.infinum.co/the-capsized-eight/articles/server-client-syncing-for-mobile-apps-...
阅读全文
摘要:高德地图开发申请KEY的时候需要开发者提供SHA1证书指纹数据,在eclipse很容易就找到了,但是Android Studio很久也没找到,只能使用在网上看到的方法了,在Android Studio中的Terminal中使用keytool获取了,具体如下图所示(输入密钥库口令--测试的默认口令为:...
阅读全文
摘要:关于Listview点击条目,自动滑动到点击条目实现:map_searchresult_list.post(new Runnable() { @Override public void run() { map_searchresult_list.smoothScrollTo...
阅读全文
摘要:两种解决方案:Two actions, first:1.Right click on the project and go to "Properties"2.Select "Java Build Path" on the left3.Open "Source" tab4.Click "Add Fol...
阅读全文
摘要:package com.view.drop;import android.content.Context;import android.content.res.TypedArray;import android.graphics.Bitmap;import android.graphics.Bitm...
阅读全文
摘要:/** * This class allows you to listen to when the user is entering the background (i.e. after a home button press, * or opening recent apps etc) and w...
阅读全文
摘要:通知栏简介:Notification can display some information for user.Some users use Android Wear platform, whichwork with notification better and use wear devices...
阅读全文
摘要:发送通知这次邮件我们将会讨论怎么获取电量状态在安卓设备上,为了完成这个目标,我们将会使用到广播。What is BroadcastReceiver?A broadcast receiver is an Android component which allows you to register fo...
阅读全文
摘要:关于eclipse运行出现,attempting to bokeyaunrun eclipse useing the jre instead of jdk,to run eclipse using错误的解决方案“Incorrect path to your JDKWhen you install t...
阅读全文
摘要:异常信息:java.lang.IndexOutOfBoundsException: index=3 count=2在instantiateItem各个条目View的时候。会有container.addView(view, 0);这样一行代码。如果写成container.addView(view, p...
阅读全文
摘要:为了解决这个问题。可以自定义viewpager,然后在里面监听首饰,自定义点击事件package com.hpuvoice.view;import android.content.Context;import android.graphics.PointF;import android.suppor...
阅读全文
摘要:fragment里面的onActivityResult 怎样才能被调用,很简单,就一句话,# startActivityForResult(intent, getActivity().RESULT_FIRST_USER);(注意,不要写成getactivity().startactivityforr...
阅读全文
摘要:关于弹出软键盘布局变形解决方案:在androidMainfest.xml文件中在此Activity中写入 android:windowSoftInputMode="adjustPan"在实际开发中,有的页面用到Edittext控件,这时候进入该页面可能会自动弹出输入法这么显示不太友好,所以需要设置一...
阅读全文
摘要:转:http://blog.sina.com.cn/s/blog_6cf2ea6a0102v61f.html开发项目中遇到一个问题,布局高度在某些国产酷派小屏幕手机上高度不够全部显示,于是使用了ScrollView嵌套LinearLayout,但问题又出现了,在大屏幕手机如三星note3手机上下面会...
阅读全文
摘要:Unhandled Exxception “Unhandled exception type IOException”?在Android studio中,自动遇见这个异常报错,如果eclipse会自动提示,但是AS提示很抽象,不容易发现,解决方案:You should add "throws IOE...
阅读全文
摘要:常见的Drawable,放置默认drawable一系列目录,有时候会发现drawable找不到的情况,其实还可以放另外一个目录下values------->>dimens.xml 16dp 16dp #ef202020 #ffe16b99 #33ffff...
阅读全文
摘要:getActionBar().setTitle(); Java.lang.NullPoint异常解决方案,是由于低版本不支持直接获取的缘故,修改方案:try changing your theme to thisand not the AppCompat Version 另外一种情况,如果是低版本...
阅读全文
摘要:com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0\bin\java....
阅读全文
摘要:Android studio libs目录:关于Android studio libs目录,Android studio 已经为我们自动生成了,如果默认是看不到默认Libs目录的,点击红色按钮地方,选择project 切换,就可以看到libs目录了》。。详细截图如下:28down vote*Clic...
阅读全文
摘要:Android Studio 添加Assets目录:法一: Since Android Studio uses the new Gradle-based build system, you should be putting assets/ inside of the source sets (e...
阅读全文
摘要:转:http://www.blueowls.net/android-strictmode%E4%BB%8B%E7%BB%8D//** * enables "strict mode" for testing - should NEVER be used in release builds ...
阅读全文
摘要:TextView中的getTextSize返回值是以像素(px)为单位的,而setTextSize()是以sp为单位的.所以如果直接用返回的值来设置会出错,解决办法是用setTextSize()的另外一种形式,可以指定单位: 在继承自View时,绘制bitmap时,需要将图片放到新建的drawab...
阅读全文