胡神

导航

文章分类 -  android

广播机制BroadcastReceiver(一、java代码注册方式)
摘要:TestBC2Activity.javapackage mars.testbc2;import android.app.Activity;import android.content.IntentFilter;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;public class TestBC2Activity extends Activity { /** Called when the activit 阅读全文

posted @ 2011-05-06 22:52 胡神 阅读(1639) 评论(0) 推荐(1)

广播机制BroadcastReceiver(一、xml注册方式)
摘要:AndroidManifest.xml 中添加<receiver android:name=".TestReceiver"><intent-filter><action android:name="android.intent.action.PICK" /></intent-filter></receiver>TestActivity.javapackage mars.testbc;import android.app.Activity;import android.content.Intent 阅读全文

posted @ 2011-05-06 22:51 胡神 阅读(746) 评论(0) 推荐(0)

XML文件解析 (下载)
摘要:main.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" ><Te 阅读全文

posted @ 2011-05-06 11:40 胡神 阅读(5826) 评论(0) 推荐(0)

AlertDialog Gallery ImageSwitcher LayoutInflater 的结合使用,弹出窗选择图片
摘要:userheadchoose.xml<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Gallery android:id="@+id/i 阅读全文

posted @ 2011-05-05 19:08 胡神 阅读(532) 评论(0) 推荐(0)

(android) 进度条ProgressBar的使用
摘要:main.xml 文件<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" >< 阅读全文

posted @ 2011-05-05 12:03 胡神 阅读(1367) 评论(0) 推荐(0)

(android) SQLite数据操作(二)
摘要:DBHelper.java 文件package org.ContactProject.DB;import java.util.ArrayList;import java.util.HashMap;import org.ContactProject.entity.User;import android.content.ContentValues;import android.content.Context;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.data 阅读全文

posted @ 2011-05-05 11:37 胡神 阅读(552) 评论(0) 推荐(0)

(android) SQLite 数据操作(一)
摘要:main.xml文件<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" >< 阅读全文

posted @ 2011-05-05 11:33 胡神 阅读(324) 评论(0) 推荐(0)

(android) menu自定义(二)
摘要:menu.xml文件<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingBottom="5dip"> < 阅读全文

posted @ 2011-05-04 23:58 胡神 阅读(3434) 评论(0) 推荐(0)

(android) menu菜单导航(一)
摘要:main.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" ><Te 阅读全文

posted @ 2011-05-04 23:47 胡神 阅读(456) 评论(0) 推荐(0)

(android) ListView DataBing(二)
摘要:user.xml文件<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" androi 阅读全文

posted @ 2011-05-03 22:40 胡神 阅读(597) 评论(0) 推荐(0)

(android) ListView DataBing(一)
摘要:user.xml文件<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" androi 阅读全文

posted @ 2011-05-03 21:58 胡神 阅读(601) 评论(0) 推荐(0)

Android应用开发控件——Gallery和ImageSwitcher
摘要:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ScrollVie 阅读全文

posted @ 2011-05-01 14:14 胡神 阅读(873) 评论(0) 推荐(0)

Android使用LayoutInflater动态加载布局和操作控件
摘要:我们知道在Android中通过布局文件来描述软件的界面,而通常在Activity中都是使用setContentView()来将布局显示出来。但是如果我们在非Activity的情况下,而且需要对布局中的控件进行设置等操作,该如何处理呢?这就需要使用到动态加载布局 LayoutInflater,下面ATAAW.COM来做介绍。 以一个简单布局example.xml为例,里面只有一个按钮和一个文本显示框控件。 < TextView android:id="@+id/tview" android:layout_width="fill_parent" and 阅读全文

posted @ 2011-05-01 13:15 胡神 阅读(16655) 评论(1) 推荐(0)

一些android 技巧汇总(menu,activity,AlertDialog...)
摘要:1.在测试时,如何实现一个提示 可以使用 1.Toast.makeText(this, "这是一个提示", Toast.LENGTH_SHORT).show(); 2.//从资源文件string.xml 里面取提示信息 3. Toast.makeText(this, getString(R.string.welcome), Toast.LENGTH_SHORT).show(); 这个提示会几秒钟后消失 2.可以使用AlertDialog.Builder 才产生一个提示框. 例如像messagebox那样的 1. new AlertDialog.Builder(this) 2 阅读全文

posted @ 2011-05-01 13:11 胡神 阅读(1402) 评论(0) 推荐(0)