android学习
yangqiuyan_
无知女程序猿。
展开
-
String.format()在android中的运用
原文:http://www.educity.cn/wenda/179253.html1、整型在xml文件中: 这位小姐今年%1$d岁了在java代码中的使用:String ageFormat = getResources().getString(R.string.old);String finalFormat = String.format(ageFormat,2转载 2016-08-22 10:46:59 · 234 阅读 · 0 评论 -
android 选择打开系统软件解压缩zip包
//android获取一个用于打开ZIP文件的intent public static Intent getZipFileIntent(String param) { Intent intent = new Intent("android.intent.action.VIEW"); intent.addCategory("android.intent.cat原创 2016-08-24 20:39:46 · 831 阅读 · 0 评论 -
android 解压缩zip文件并取出所有文件
1.选择某个zip文件后,在zip文件的目录创建一个与zip文件同名的文件夹,并在该文件夹下解压缩因为在windows和在mac下压缩所采用的编码不一样,有可能导致中文名解压缩出来出现乱码。解压缩windows zip包需要设置编码为GBK,解压缩mac zip包需要设置编码为UTF-8。一开始时默认解压缩编码为GBK,若zip包为mac压缩,则转换成UTF-8重新解压缩。能解决大部分的中文名原创 2016-08-25 19:48:57 · 1510 阅读 · 2 评论 -
android 子线程进行网络连接等操作-AsyncTask方法
自己写的一个项目,用户可以发布文章,以及进行评论。用户进行操作时,需要进行网络连接,将耗时操作放在子线程中执行。1.创建一个类,继承AsyncTask类,在该类中进行网络操作 class sumbitReplay extends AsyncTask { @Override protected Boolean doInBackground(Integer... params) {原创 2016-08-26 10:04:27 · 405 阅读 · 0 评论 -
关于Can't create handler inside thread that has not called Looper.prepare()
在子线程中,如果程序要启动一个Dialog,则有可能会出现Can't create handler inside thread that has not called Looper.prepare()错误。1.可以在Dialog前后包上,Looper.prepare() Looper.loop()来启动Dialog。这种方法我在测试的时候,遇到若是一直点击弹出对话框,在一定的次数后,会照成界面原创 2016-08-25 20:23:50 · 594 阅读 · 0 评论