自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 收藏
  • 关注

原创 Fragment嵌套ViewPager切换后数据消失ViewPager空白问题

getChildFragmentManager替换掉getFragmentManager 或者getSupportFragmentManager()问题就解决了。具体的原理是什么,有待学习。  getFragmentManager到的是activity对所包含fragment的Manager,而如果是fragment嵌套fragment,那么就需要利用getChildFragmentManage

2016-04-08 15:09:35 1132

原创 单例模式的最佳写法

public volatile static Singleton singleton; public Singleton() { super(); // TODO Auto-generated constructor stub } public static Singleton getSingleton() { if(singleton == null){ synch

2016-03-23 10:19:05 487

原创 设置Android studio 忽略项目路径

在gradle.properties文件设置 com.android.build.gradle.overridePathCheck=true 即可忽略项目路径 不检查是否有中文

2016-03-17 11:13:52 985

原创 handler机制

handler通过在线程之间传递消息来更新ui,一些耗时的操作不能直接在UI线程进行操作,否则会出现“应用程序无响应”等提示,这时,则需要用到handler。 handler的机制是handler发送一条消息,存放于messagequeue中,然后由looper从message queue中取出message,再有handler进行处理和分发。 在子线程中做完耗时操作后,通过handler.s

2015-12-16 11:21:18 451

原创 让textview可以滚动

首先在 <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="New Text" android:id="@+id/textcontent" android:singleLine="false" android

2015-11-06 15:22:10 368

原创 cannot be cast to android.widget.HeaderViewListAdapter

在写listview下拉刷新和上拉加载的时候,会遇到这个问题,一般产生这个问题的原因是还没有setadapter就添加或者移除view,解决方法就是要确保addHeaderView(view)和addFooterView(view)方法是在ListView.setAdapter(adapter)之前执行,切记~

2015-11-05 15:57:02 321

原创 关于百度地图 SDKInitializer.initialize(getApplicationContext());出错的问题

昨天使用Android Studio 加入百度地图时遇到了SDKInitializer.initialize(getApplicationContext()); 不能初始化的问题,经过排查发现是因为自己的目录建错了,后来改为了这样: 然后在build.gradle中加入一段话: sourceSets {     main {         jniLibs.srcDirs =

2015-09-25 10:32:43 5370 1

原创 使用android camera调用自带的Intent时遇到的问题

问题一:照相时代码 Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);     fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);     intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);     startActi

2015-09-09 15:46:55 547

原创 recyclerview的基本用法(一)

今天,工作忙完了,写了一下recyclerview的基本用法,recyclerview 是android 5.0中新出的一个控件,可以很好的代替listview,gridview以及瀑布流,下面以listview为准,写一个例子: 首先:布局文件 xmlns:android="http://schemas.android.com/apk/res/android" xmlns:too

2015-08-20 17:19:27 350

空空如也

空空如也

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

TA关注的人

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