- 浏览: 281877 次
- 性别:
- 来自: 广州
最新评论
-
xianwubiao:
坑爹。。。。。
IOS之简单选择器UIPickerView(省份+城市) -
yanransysu:
为啥结果没有显示图片嘞,我都已经把你共享的文件给放进去了?
IOS之集合视图UICollectionView -
ajxjwha:
获取的总是空,为什么?!
IOS之简单选择器UIPickerView(省份+城市) -
如果宅:
附件下载下来是图片!
IOS之集合视图UICollectionView -
ikrboy:
小红星凯 写道找不到pickview 那个协议怎么搞?步骤写得 ...
IOS之简单选择器UIPickerView(省份+城市)
文章列表
SQLite数据库
- 博客分类:
- Android数据库与配置信息
一、新建数据库
1.新建数据库的类
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class SQLiteDataBase extends SQLiteOpenHelper {
private static final String name = "android"; //数据库名称
private static f ...
添加权限:
<uses-permission
android:name="android.permission.VIBRATE" />
private Vibrator mVibrator01;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.vibrator);
mVibrator01 = (Vibrator) getApplication ...
Notification状态栏通知
- 博客分类:
- Android控件应用
private NotificationManager myNotiManager;
private Button button1;
private Button button2;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.notification);
myNotiManager = (NotificationManager) getSystemService(NOTIFICATIO ...
添加权限:
<uses-permission
android:name="android.permission.READ_CONTACTS"></uses-permission>
try {
/* 必须要有android.permission.READ_CONTACTS权限 */
Cursor cursor = managedQuery(
android.provider.ContactsContract.Contacts.CONTENT_URI,
null, null, null, ...
主程序:
private List<String> items = null;
private List<String> paths = null;
private String rootPath = "/";
private TextView mPath;
private ListView listView1;
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.file_b ...
切换Activity的特殊显示效果
- 博客分类:
- Android特殊效果
private Button button1;
private Button button2;
private Button button3;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity);
//添加界面切换效果,注意只有Android的2.0(SdkVersion版本号为5)以后的版本才支持
int version = Integer.value ...
通过Gmail发送邮件
- 博客分类:
- Android手机服务与数据处理
private EditText mEditText01;
private EditText mEditText02;
private EditText mEditText03;
private EditText mEditText04;
private Button mButton01;
private String[] strEmailReciver;
private String strEmailSubject;
private String[] strEmailCc;
private String strEmailBody;
publi ...
添加发送短信的权限
<uses-permission
android:name="android.permission.SEND_SMS"></uses-permission>
EditText mobileView;
EditText contentView;
Button send;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setCon ...
功能介绍:当你输入的是电话号码时,点击链接就会到拨打电话的程序里。同样适用于E-mail和网址。
Linkify.addLinks(mTextView01,Linkify.WEB_URLS|Linkify. EMAIL_ADDRESSES|Linkify.PHONE_NUMBERS);
或者在xml文件的TextView中配置属性:
android:autoLink="web|phone|E-mail"
或者
android:autoLink="all"
添加权限
<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission><!-- 放在application标签之外-->
private Button mButton1;
private EditText mEditText1;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
se ...
private String items[] = {"项目1" , "项目2" ,"项目3" ,"项目4" ,"项目5"};
private int icons[] = {R.drawable.img1 , R.drawable.img2 , R.drawable.img3 , R.drawable.img4, R.drawable.img5};
private SlidingDrawer slidingDrawer;
private GridView gridView;
...
一、放大、缩小图片
private LinearLayout imageLayout;
private ImageView imageView;
private Button bt_big;
private Button bt_small;
private float scaleWidth = 1;
private float scaleHeight = 1;
private int id = 0;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInst ...
private ImageView mImageView;
private String filePath = "/mnt/sdcard/DCIM/Camera/abc.jpg";
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.bitmap);
mImageView = (ImageView) findViewById(R.id.imageView1);
...
FileBrowser.java
private List<String> items = null;
private List<String> paths = null;
private String rootPath = "/";
private TextView mPath;
private ListView listView1;
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R. ...
GridView表格化布局
- 博客分类:
- Android控件应用
//定义图片整型数组
private int[] mImages={
R.drawable.img1,
R.drawable.img2,
R.drawable.img3,
R.drawable.img4,
R.drawable.img5
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ni ...