摘要: 在主页中显示图片,然后点击向上翻或者向下翻能够实现图片的切换xml中两个button组件,还有一个ImageSwitcher组件<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" 阅读全文
posted @ 2013-03-18 22:07 小三小山 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 项目需求:通过点击按钮,显示出来一个对话框,选择其中一个选项之后出来一个进度对话框,一段时间之后自动消失。xml文件中<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" too 阅读全文
posted @ 2013-03-18 21:45 小三小山 阅读(119) 评论(0) 推荐(0) 编辑
摘要: AlertDialog应用2xml中添加一个按钮就可以<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity&q 阅读全文
posted @ 2013-03-18 21:26 小三小山 阅读(174) 评论(0) 推荐(0) 编辑
摘要: AlertDialog对话框应用一项目需求:在主页面上显示一个button,点击button,跳出一个对话框,里面有图片,文字还有按钮可以选择;xml中添加一个button<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height=& 阅读全文
posted @ 2013-03-18 20:50 小三小山 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 一、基础1、说明:创建数据库CREATE DATABASE database-name2、说明:删除数据库drop database dbname3、说明:备份sql server---创建 备份数据的deviceUSE masterEXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat'---开始 备份BACKUP DATABASE pubs TO testBack4、说明:创建新表create table tabname(col1 type1 [not n 阅读全文
posted @ 2013-03-18 00:37 小三小山 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 集合在使用java的过程,会遇到各种各样的集合,所有的集合都实现了Collection接口list 中有 vector、ArrayList、LinkedList 。 set中HashSet,LinkedHashSet,SortedSet,TreeSetVector:基于Array的list,其实就是封装了Array所不具备的一些功能方便使用。Vector是同步(Synchronized)是线程安全的,arraylist的方法不是ArrayList:基于Array的链表,它不是同步的,在性能上臂Vector优越,LinkedList:不是基于Array的,每一个节点都包含两方便的内容:1.节点本 阅读全文
posted @ 2013-03-15 01:02 小三小山 阅读(132) 评论(0) 推荐(0) 编辑
摘要: android中的数据库只有唯一的SQLite,这样便于操作,该数据库是android自带的数据库,用户无需向j2ee那样,没做一个东西要添加一个jar文件,多么的麻烦。一、数据库的创建package com.will.db;import android.content.Context;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;public class DBConn extends SQLiteOpenHelper{ public DBConn... 阅读全文
posted @ 2013-03-15 00:36 小三小山 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 单选跟多选的差别在于其中一个元素的不同而已,先看以下的代码:xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="verti 阅读全文
posted @ 2013-03-15 00:24 小三小山 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 通过ListView实现组件单选,并能够对其中的值进行读取的操作。以下是具体的代码: main xml代码:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:or 阅读全文
posted @ 2013-03-15 00:20 小三小山 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 通过java代码中定义Toast函数可以达到跟在xml文件中定义一样的效果,具体实现如下:package com.will.test;import android.app.Activity;import android.os.Bundle;import android.widget.ImageView;import android.widget.LinearLayout;import android.widget.Toast;public class MainActivity extends Activity{ @Override protected void onCreate(B... 阅读全文
posted @ 2013-03-15 00:16 小三小山 阅读(117) 评论(0) 推荐(0) 编辑