`
文章列表
一、新建数据库 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 ...
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 ...
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 ...
  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. ...
  //定义图片整型数组 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 ...
Global site tag (gtag.js) - Google Analytics