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