自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(14)
  • 资源 (1)
  • 收藏
  • 关注

原创 Android的生命周期

什么是生命周期?对象从创建到销毁的阶段,必须会执行的方法,这些方法就是生命周期的回调* oncreate()  activity被创建的时候调用的方法> ui界面的初始化 setContentView()* onDestroy() activity被销毁的时候调用的方法> 界面退出之前的扫尾操作,短信发送器,退出前数据的保存。* onStar

2015-07-22 21:14:08 285

原创 禁用掉横竖屏切换

在一些特殊的应用程序常见下,比如游戏,不希望横竖屏切换activity被销毁重新创建需求:禁用掉横竖屏切换的生命周期1. 横竖屏写死 android:screenOrientation="landscape"android:screenOrientation="portrait"2. 让系统的环境 不在去敏感横竖屏的切换。android:configChange

2015-07-22 21:09:54 353

原创 java.lang.ClassCastException: android.app.ActionBar$LayoutParams cannot be cast to android.widget.Ab

LayoutParams lp=new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT);中LayoutParams包导错了,应该是import android.widget.AbsListView.LayoutParams;

2015-07-22 20:37:59 884

原创 android中菜单的使用(xml)

main.xml         android:id="@+id/sms"        android:icon="@drawable/sms"        android:orderInCategory="100"        android:showAsAction="never"        android:title="短信">         

2015-07-01 20:50:06 311

原创 android中布局填充器LayoutInflater的使用

//改变本界面的布局 //布局填充器 //获取此对象有三种方式: //LayoutInflater ll = LayoutInflater.from(this) ; //LayoutInflater out = getLayoutInflater() ; LayoutInflater ll= (LayoutInflater) getSystemService(Conte

2015-07-01 20:47:30 412

原创 android中控件Dialog对话框的使用

public void click(View view){ AlertDialog.Builder ad = new AlertDialog.Builder(this) ; ad.setTitle("普通对话框") .setIcon(R.drawable.ic_launcher) .setMessage("哈哈哈,我弹出来了") .setNegativeButton("取消",

2015-07-01 20:44:43 449

原创 android中控件DatePicker控件

activity_main.xml          android:id="@+id/dp"        android:layout_width="match_parent"        android:layout_height="wrap_content" />            android:layout_width="match_parent"

2015-07-01 20:39:31 302

原创 Android中控件ListView列表控件baseadapter方法介绍

activity_main.xml          android:id="@+id/lv"       android:layout_width="match_parent"       android:layout_height="match_parent"       >MainActivity.javapublic class Ma

2015-07-01 20:34:21 367

原创 android中控件AutoCompleteView自动提示控件

activity_main.xml android:id="@+id/auto" android:layout_width="match_parent" android:layout_height="wrap_content"android:completionThreshold="1" android:completionHint="请选择"/>android:com

2015-07-01 20:29:55 275

原创 android中控件ToggleButton开关控件

在activity_main.xml            android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:textOn="开灯"        android:textOff="关灯"        android:onClick=

2015-07-01 20:26:08 286

原创 android中控件Checkbox复选框的使用

在layout的activity_main.xml            android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="请选择爱好:" />            android:id="@+id/eat

2015-07-01 20:21:12 511

原创 android中控件RadioButton的使用

在layout的activity_main.xml中             android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="请选择国籍:" />            android:id="@+id/r

2015-07-01 20:15:20 430

原创 Android中控件spinner的使用

在layout中的 activity_main.xml添加        android:id="@+id/sp"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:entries="@array/city"

2015-07-01 20:07:15 315

转载 用dom4j解析xml

public class XmlParser {    @SuppressWarnings("unchecked")    public static People parseXml(String xmlPath){        File xmlFile=new File(xmlPath);        System.out.println(xmlPath.getBytes()

2015-04-01 10:16:54 279

空空如也

空空如也

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

TA关注的人

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