摘要:Activity.this和getApplicationContext()的差异:在运用语句:AlertDialog.Builder builder=new AlertDialog.Builder(this);这里的参数this指的是Activity.this,换句话说,这个参数指的就是这个Acti...
阅读全文
摘要:LayoutInflater的作用是导入界面,说白了就是查找layout中的.xml界面并导入。如下:public class MainActitivity extends Acticity{ TextView textView; public void onCreate(Bundle save...
阅读全文
摘要:Intent主要负责组件之间的跳转,有两种用法:1.显式用法:Intent intent =new Intent(this,TargetActivity.class);startActivity(intent);其中,this指的是当前的.java文件,TargetActivity.class即是要...
阅读全文
摘要:Application用于存储和访问任何界面的变量,也就是说,在一个工程里,我们可以在Application定义全局变量,在其他Activity中引用。具体用法如下:1.建立MyApplication.java文件package entity;import com.android.volley.Re...
阅读全文
摘要:anim中的四个xml文件:1.alpha.xml: 2.scale.xml 3.translate.xml: 4.rotate.xml: layout中的xml文件activity_main.xml: src中的.java文件M...
阅读全文
摘要:Android消息机制:Message,handler,looper类的使用及消息的传递主线程和子线程之间的消息传递————————————————— ——> Messagemessagemessage——>looper—↑——————————————↓——Params:启动参数StringP...
阅读全文
摘要:1.适配器:package com.example.adapter;import java.util.ArrayList;import android.annotation.SuppressLint;import android.app.ActionBar.LayoutParams;import a...
阅读全文
摘要:1.实体类:package com.example.adapter;public class DangDang {private String writers;private int img;private String price;private String critical;public St...
阅读全文