- 博客(35)
- 收藏
- 关注
翻译 各种utils类
https://github.com/Blankj/AndroidUtilCodehttps://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/README-CN.md
2017-12-07 17:16:37
1772
1
转载 Collections.sort对List排序的两种方法
原文 http://blog.youkuaiyun.com/wxx614817/article/details/50628197一、Collections.sort的简单使用说到List的排序,第一反应当然是使用Collections.sort,方便简单。下面实现一下~~ [html] view plain copy private void sortStrings() { List list
2017-12-06 14:58:07
597
转载 自定义View
本文摘自 http://blog.youkuaiyun.com/lfdfhl/article/details/51671038[探索Android软键盘的疑难杂症]自定义View系列教程00–推翻自己和过往,重学自定义View 自定义View系列教程01–常用工具介绍 自定义View系列教程02–onMeasure源码详尽分析 自定义View系列教程03–onLayout源码详尽分析 自定义Vi
2017-12-05 16:09:27
242
原创 获取系统当前时间,24小时制
Date data = new Date(); SimpleDateFormat sdformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:00");//24小时制 date = sdformat.format(data);
2016-11-08 16:03:40
4255
原创 android 版本更新的应用
在AndroidManifest.xml里定义了每个Android apk的版本标识:<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.month01" android:versionCode="1" android:versionName="1.
2016-08-31 17:56:15
415
原创 判断软键盘显示还是隐藏
InputMethodManager imm = (InputMethodManager) mActivity.getSystemService(Activity.INPUT_METHOD_SERVICE); if (imm.hideSoftInputFromWindow(holder.itemView.getWindowToken(), 0)) {
2016-08-24 15:53:54
366
原创 Zxing二维码
在project下 build.gradle 中dependencies { classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' }在app下 build.gradle中dependencies { compile project(':libraryzxing')}android {
2016-08-17 16:50:45
290
原创 集成百度地图找不到so库
在app build.gradle 添加sourceSets { main { jniLibs.srcDirs = ['libs'] }}
2016-08-12 15:19:09
397
原创 viewpager轮播图片设置OntounchListener
@Override public Object instantiateItem(ViewGroup container, int position) { View view = View.inflate(context, R.layout.pic_item, null); ImageView imageview=(ImageView) view.findVie
2016-07-27 15:05:32
264
原创 ViewPager无限自动轮播
Handler handler = new Handler() { @Override public void handleMessage(Message msg) { super.handleMessage(msg); int currentItem = viewpager.getCurrentItem();
2016-06-30 11:09:33
374
原创 图片转化为Base64格式
public static String bitmapToString(Bitmap bitmap) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 60, baos); byte[] b = b
2016-06-12 15:02:53
376
原创 数组传递
ArrayList<Like> list = fromJson.data .get(arg2).like_user_list; /*String[] st = new String[list.size()];
2016-06-02 08:25:09
314
原创 xml解析网络请求
实体类News.javapackage com.baway.test.bean;public class News { public String item; public String title; public String catalog; public String tags; public String sub1; public String
2016-06-02 08:07:07
285
原创 判断联网状态(是否有网)
获取网络信息需要在AndroidManifest.xml文件中加入相应的权限。 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 判断网络连接状态方法public boolean isNetworkConnected(Context context) { if (context !=
2016-06-01 11:59:00
682
原创 SharedPreferences导航
// 得到SharedPreferences SharedPreferences sharedPreferences = getSharedPreferences("xin", MODE_PRIVATE); // 给SharedPreferences存个值 boolean boolean1 = sharedPrefere
2016-05-31 20:35:58
284
原创 百度地图定位
需要的权限在application标签中声明service组件,每个app拥有自己单独的定位service<service android:name="com.baidu.location.f" android:enabled="true" android:process=":remote"></service>定位SDKv3.1版本之后,此权限已不需要,请取消声明,否则将由于Android 5.
2016-05-31 20:27:09
323
原创 全选、反选
XML布局activity_main.xml布局<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:l
2016-05-31 17:49:44
270
原创 自定义View(多点触控)
XML布局<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="mat
2016-05-31 17:12:42
382
原创 自定义View(单点触控)
XML布局中<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="ma
2016-05-31 17:10:18
451
原创 SlidingMenu侧滑
XML布局 activity_main.xml<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android
2016-05-30 21:54:50
270
原创 Fragment工厂模式
XML布局文件中 <android.support.v4.view.ViewPager android:id="@+id/viewPager" android:layout_width="match_parent" android:layout_height="match_parent" > </android.support.v4.view.
2016-05-27 09:41:19
716
原创 ExpandableListview二级菜单
XMLzhong <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height=
2016-05-27 09:35:12
352
原创 Fragment之间的相互替换(内有httpclient请求)
MainActivitypackage com.example.textwork2;import android.os.Bundle;import android.app.Activity;import android.support.v4.app.FragmentActivity;import android.support.v4.app.FragmentManager;import an
2016-05-27 09:27:08
624
原创 (HttpURLConnection )AsyncTask解析xml
package com.baway.test;import java.io.ByteArrayOutputStream;import java.io.IOException;import java.io.InputStream;import java.net.HttpURLConnection;import java.net.URL;import java.util.ArrayList;i
2016-05-23 08:25:49
497
原创 xml解析
public class MainActivity extends Activity implements IXListViewListener { protected static final String tag = "MainActivity"; int pageIndex = 1; private String path; private List<News>
2016-05-16 08:06:13
235
原创 打开二级列表,关闭其他二级列表
点击二级列表 并关闭其他二级列表expandableListView.setOnGroupExpandListener(new OnGroupExpandListener() { @Override public void onGroupExpand(int groupPosition) { //
2016-03-31 21:33:46
318
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人