android
JC_KK
。。。。。。。。。
展开
-
GsonFormat的使用
GsonFormat的使用 一.Android Studio快速添加Gson 1、点击File下选择Project Structure: 2、选择App下的Dependencies然后在点击“+”号键: 3、点击“+”号选择Library dependency: 4、往下拉找到gson:点击OK导入项目中去 二、使用Android Studio中GsonFormat的生成实体类原创 2017-11-09 16:54:04 · 999 阅读 · 0 评论 -
Android 调用系统分享功能
1.分享信息,比如文字数据….Intent shareIntent = new Intent();shareIntent.setAction(Intent.ACTION_SEND);shareIntent.putExtra(Intent.EXTRA_TEXT, "分享中的文字");shareIntent.setType("text/plain");//设置分享列表的标题star原创 2018-01-18 16:05:41 · 1011 阅读 · 0 评论 -
Tooblar +Drawerlayout 点击事件穿透解决办法
比如在Drawerlayout 放上一些ImageButton等控件后,发现在点击时会穿透到下面的界面对象上。 解决方法:给控件添加属性:android:clickable="true"原创 2018-01-03 09:20:01 · 297 阅读 · 0 评论 -
点击按钮 按钮缩放动画:
1,有时候在项目开发中遇到一些按钮的点击动画,下面就写一个比较简单的按钮缩放效果首先我们的在res目录下amin文件下创建一个Xml文件夹用来设置动画的效果,<set xmlns:android="http://schemas.android.com/apk/res/android"> <scale android:fromXScale="1.0" android:toXSc原创 2017-12-18 08:50:07 · 1565 阅读 · 0 评论 -
ViewPager自动轮播+底部文字动态+底部小圆点动态滑动
今天项目中突然要加上这个功能,我还是翻了一下之前的代码!想了想还是写出来,方便以后看。 1,然后我们就看一下适配器,也很简单新建Adapter继承自PagerAdapter package com.example.administrator.airport.Adapter;import android.content.Context;import android.support.v4.vi原创 2017-12-20 14:38:16 · 476 阅读 · 0 评论 -
Android中Bundle传递数据和对象
1.Bundle传递数据, 因为Bundle中已经封装好了简单数据类型,所以我们直接去设置数据,下面就来看看具体的操作: case R.id.Btn_Msg: // 实例化一个Bundle Bundle bundle = new Bundle(); Intent intent=new Intent原创 2017-12-19 15:40:46 · 35670 阅读 · 0 评论 -
Android Fragment+ViewPager的用法
1.这里编写一个类似QQ主界面的小Demo,方便以后用的时候可以直接看。首先我们需要搭建界面,一般内容界面都是写在Fragment里面。新建activity_main.xml作为程序的主布局文件,在里面加入如下代码:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="ht原创 2017-11-16 14:50:01 · 321 阅读 · 0 评论 -
自定义PopupWindow提示
1.有时候在项目中多处用到PopupWindow,所以直接封装出来一个,方便以后用直接可以复制首先看一下工具类和其用到的布局import android.content.Context;import android.graphics.drawable.BitmapDrawable;import android.view.LayoutInflater;import android.view.V原创 2017-11-16 11:24:54 · 741 阅读 · 0 评论 -
日期选择器DailLog提示框
1.封装好的,直接复制下来就可以用了,先看下封装好的工具类import android.annotation.SuppressLint;import android.app.AlertDialog;import android.content.Context;import android.content.DialogInterface;import android.view.LayoutI原创 2017-11-16 10:58:03 · 266 阅读 · 0 评论 -
ExpandableListView的使用
1.ExpandableListView是可扩展的下拉列表,它的可扩展性在于点击父item可以拉下或收起列表,下面上代码—布局直接用<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" andr原创 2017-11-15 15:25:23 · 271 阅读 · 0 评论 -
ListView快速添加头部
1.给ListView添加头部很简单,就是在setAdapter()之前执行 listView.addHeaderView(vhead); 下面就是代码:package com.example.administrator.listviewaddhead;import android.os.Bundle;import android.support.v7.app.AppCompatA原创 2017-11-10 14:48:35 · 433 阅读 · 0 评论 -
Volley请求,GET+POST
1. * 利用StringRequest实现Get请求 //创造一个请求方式 StringRequest stringRequest = new StringRequest(Request.Method.GET, Url, new Response.Listener<String>() { //请求出来的回调运行在UI线程中原创 2017-11-10 14:19:33 · 393 阅读 · 1 评论 -
LayoutInflater的基本用法
1.对于LayoutInflater我们在项目中都会经常看到,也会用到!其实LayoutInflater的主要用途是用来加载布局的。在项目中加载布局的任务通常都是在Activity中调用setContentView()方法来完成的。其实setContentView()方法的内部也是使用LayoutInflater来加载布局的,首先先来看一下LayoutInflater的基本用法: 首先我们需要原创 2018-01-19 09:51:02 · 658 阅读 · 1 评论