02 2012 档案

摘要:虽然Apache下有个时间工具类的包,但这里写得时间工具类主要是自己在工作中常用的一些求时间的方法,见代码: 1 [java] view plaincopyprint? 2 /** 3 * UtilsTest 4 * 时间日期工具类,封装工作中常用的一些时间日期计算方法等 5 * 还可以提供更多的重载方法,用于时间的转化等 6 */ 7 package com.labci.util.test; 8 import java.text.DateFormat; 9 import java.text.ParseException; 10 import ... 阅读全文
posted @ 2012-02-25 16:04 灰太狼_lilongmin 阅读(2398) 评论(0) 推荐(0) 编辑
摘要:1 <!-- 2 加粗中文 android:shadowColor="#000000" 3 android:shadowDx="0.2" 4 android:shadowDy="0.0" 5 android:shadowRadius="0.2" 6 --> 7 <TextView 8 android:id="@+id/notice_title" 9 an... 阅读全文
posted @ 2012-02-25 14:54 灰太狼_lilongmin 阅读(248) 评论(0) 推荐(0) 编辑
摘要:1 public class StringUtils 2 { 3 /** 4 * 判断给定字符串是否空白串。<br> 5 * 空白串是指由空格、制表符、回车符、换行符组成的字符串<br> 6 * 若输入字符串为null或空字符串,返回true 7 * @param input 8 * @return boolean 9 */10 public static boolean isBlank( String input ) 11 {12 if ( input == null || "".equals( i... 阅读全文
posted @ 2012-02-23 17:02 灰太狼_lilongmin 阅读(2454) 评论(0) 推荐(0) 编辑
摘要:1 public void transImage(String fromFile, String toFile, int width, int height, int quality) 2 3 { 4 5 try 6 7 { 8 9 Bitmap bitmap = BitmapFactory.decodeFile(fromFile);10 11 int bitmapWidth = bitmap.getWidth();12 13 int bitmapHeight = bitm... 阅读全文
posted @ 2012-02-23 10:16 灰太狼_lilongmin 阅读(942) 评论(0) 推荐(0) 编辑
摘要:1 // 注册2 dateReceiver = new DateReceiver();3 IntentFilter filter = new IntentFilter();4 filter.addAction(Intent.ACTION_DATE_CHANGED);5 StartUp.this.registerReceiver(dateReceiver, filter); 阅读全文
posted @ 2012-02-22 20:13 灰太狼_lilongmin 阅读(188) 评论(0) 推荐(0) 编辑
摘要:1. 下列哪些语句关于内存收受接管的申明是正确的? (b )A、 法度员必须创建一个线程来开释内存B、 内存收受接管法度负责开释无用内存C、 内存收受接管法度容许法度员直接开释内存D、 内存收受接管法度可以在指定的时候开释内存对象2. 下面异常是属于Runtime Exception 的是(abcd)(多选) A、ArithmeticException B、IllegalArgumentException C、NullPointerException D、BufferUnderflowException3. Math.round(11.5)便是几许(). Math.round(... 阅读全文
posted @ 2012-02-22 18:23 灰太狼_lilongmin 阅读(851) 评论(0) 推荐(0) 编辑
摘要:1 public class MyActivity extends Activity{ 2 ... 3 4 public static class Receiver extends BroadcastReceiver{ 5 6 @Override 7 public void onReceive(Context context, Intent intent) { 8 .... 9 }10 11 }12 13 ...14}1 <receiver android:name=".org.dan... 阅读全文
posted @ 2012-02-22 17:50 灰太狼_lilongmin 阅读(1116) 评论(0) 推荐(0) 编辑
摘要:1 public class LaunchNotificationActivity 2 extends Activity { 3 /** Called when the activity is first created. */ 4 @Override 5 public void onCreate(Bundle savedInstanceState) { 6 super.onCreate(savedInstanceState); 7 8 LinearLayout layout = new LinearLayout(this);... 阅读全文
posted @ 2012-02-21 16:57 灰太狼_lilongmin 阅读(332) 评论(0) 推荐(0) 编辑
摘要:这样的场景:OA中的报销审批。如果老板公务缠身,经常出差,员工经常会抱怨得不到及时的报销审批。因此类似审批性质的需求在移动OA中很常用。下面用这样的场景演示一下Android的通知的使用。写了个简单的Activity,按按钮,就产生一个通知,并且有声音提示。下拉通知栏:点选该通知条目,重新进入上面的那个简单的Activity,当然可以打开其他的Activity,这里为了示例简单。可以看到这回提示的通知图标在点选后消失了。源码见:http://easymorse.googlecode.com/svn/trunk/android.notification/主要起作用的代码,就是点击按钮后的处理部分 阅读全文
posted @ 2012-02-21 11:29 灰太狼_lilongmin 阅读(2191) 评论(0) 推荐(0) 编辑
摘要:编辑器加载中...可以去除信息栏1 private Bitmap shot(Activity activity) { 2 // View是你需要截图的View 3 View view = activity.getWindow().getDecorView(); 4 view.setDrawingCacheEnabled(true); 5 view.buildDrawingCache(); 6 Bitmap b1 = view.getDrawingCache(); 7 8 // 获取状态栏高... 阅读全文
posted @ 2012-02-20 10:26 灰太狼_lilongmin 阅读(544) 评论(0) 推荐(0) 编辑
摘要:1 imageView.setScaleType(ImageView.ScaleType.FIT_XY ); 1 这里我们重点理解ImageView的属性android:scaleType,即ImageView.setScaleType(ImageView.ScaleType)。android:scaleType是控制图片如何resized/moved来匹对ImageView的size。ImageView.ScaleType / android:scaleType值的意义区别: 2 3 CENTER /center 按图片的原来size居中显示,当图片长/宽超过View的长/宽,则截取... 阅读全文
posted @ 2012-02-19 00:43 灰太狼_lilongmin 阅读(79812) 评论(2) 推荐(6) 编辑
摘要:1 Thread thread = new Thread(new UpdateStatusThread());2 thread.start(); 1 // 发表微博 2 class UpdateStatusThread 3 implements Runnable { 4 public void run() { 5 int what = -1; 6 Status status = null; 7 weibo.setToken(accessToken, accessSecret);... 阅读全文
posted @ 2012-02-18 22:36 灰太狼_lilongmin 阅读(211) 评论(0) 推荐(0) 编辑
摘要:1 import java.io.File; 2 3 import android.app.Activity; 4 import android.graphics.Bitmap; 5 import android.graphics.BitmapFactory; 6 import android.os.Bundle; 7 import android.view.View; 8 import android.widget.Button; 9 import android.widget.ImageView; 10 import android.widget.Te... 阅读全文
posted @ 2012-02-18 21:20 灰太狼_lilongmin 阅读(609) 评论(0) 推荐(1) 编辑
摘要:1 package com.ql.app; 2 3 import java.util.ArrayList; 4 import java.util.List; 5 6 import android.app.Activity; 7 import android.content.Intent; 8 import android.os.Bundle; 9 import android.view.View; 10 import android.widget.Button; 11 import android.widget.EditText; 12 import... 阅读全文
posted @ 2012-02-18 21:07 灰太狼_lilongmin 阅读(278) 评论(0) 推荐(0) 编辑
摘要:http://blog.csdn.net/xieqibao/article/details/6682128 阅读全文
posted @ 2012-02-18 20:54 灰太狼_lilongmin 阅读(190) 评论(0) 推荐(0) 编辑
摘要:1 package com.bingo.util; 2 3 import java.io.BufferedOutputStream; 4 import java.io.ByteArrayOutputStream; 5 import java.io.File; 6 import java.io.FileOutputStream; 7 import java.io.IOException; 8 import java.io.InputStream; 9 10 import android.graphics.Bitmap; 11 import android.graphics... 阅读全文
posted @ 2012-02-18 20:26 灰太狼_lilongmin 阅读(4972) 评论(0) 推荐(0) 编辑
摘要:1 方法一: 2 public void saveFile(Bitmap bm, String fileName) 3 throws IOException { 4 File dirFile = new File(ALBUM_PATH); 5 if (!dirFile.exists()) { 6 dirFile.mkdir(); 7 } 8 File myCaptureFile = new File(ALBUM_PATH + fileName); 9 BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStrea. 阅读全文
posted @ 2012-02-18 19:47 灰太狼_lilongmin 阅读(342) 评论(0) 推荐(0) 编辑
摘要:1.public byte[] getBitmapByte(Bitmap bitmap) { ByteArrayOutputStream out = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out); try { out.flush(); out.close(); } catch (IOException e) { e.printStackTrace(); } return out.toByteArray(); }2.调用getBitmapByte();byte[] conten 阅读全文
posted @ 2012-02-18 17:19 灰太狼_lilongmin 阅读(2783) 评论(0) 推荐(0) 编辑
摘要:/** * 判断存储卡是否存在 * * @return */ public static boolean existSDcard() { if (android.os.Environment.MEDIA_MOUNTED.equals(android.os.Environment.getExternalStorageState())) { return true; } else return false; } 阅读全文
posted @ 2012-02-17 15:54 灰太狼_lilongmin 阅读(172) 评论(0) 推荐(0) 编辑
摘要:问题:调用处:Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);startActivityForResult(intent, RESULT_OK);获取图片处: @Override protected void onActivityResult(int requestCode, int resultCode, Intent data){ if (resultCode == RESULT_OK){ Bundle bundle = data.getExtras(); Bitmap bitmap = (Bitmap) b... 阅读全文
posted @ 2012-02-17 14:10 灰太狼_lilongmin 阅读(1224) 评论(0) 推荐(0) 编辑
摘要:package com.amani.main;import java.io.ByteArrayOutputStream;import java.io.InputStream;import android.app.Activity;import android.app.AlertDialog;import android.content.ContentResolver;import android.content.DialogInterface;import android.content.Intent;import android.graphics.Bitmap;import android. 阅读全文
posted @ 2012-02-17 13:06 灰太狼_lilongmin 阅读(1736) 评论(0) 推荐(0) 编辑
摘要:软键盘的Enter键默认显示的是“完成”文本,我们知道按Enter建表示前置工作已经准备完毕了,要去什么什么啦。比如,在一个搜索中,我们输入要搜索的文本,然后按Enter表示要去搜索了,但是默认的Enter键显示的是“完成”文本,看着不太合适,不符合搜索的语义,如果能显示“搜索”两个字或者显示一个表示搜索的图标多好。事实证明我们的想法是合理的,Android也为我们提供的这样的功能。通过设置android:imeOptions来改变默认的“完成”文本。这里举几个常用的常量值:actionUnspecified 未指定,对应常量EditorInfo.IME_ACTION_UNSPECIFIED. 阅读全文
posted @ 2012-02-13 13:48 灰太狼_lilongmin 阅读(1057) 评论(0) 推荐(0) 编辑
摘要:// 跳到界面指定位置 scrollView.scrollTo(0, 512); 阅读全文
posted @ 2012-02-06 18:18 灰太狼_lilongmin 阅读(144) 评论(0) 推荐(0) 编辑
摘要:Intent应该算是Android中特有的东西。你可以在Intent中指定程序要执行的动作(比如:view,edit,dial),以及程序执行到该动作时所需要的资料。都指定好后,只要调用startActivity(),Android系统会自动寻找最符合你指定要求的应用程序,并执行该程序。下面列出几种Intent的用法显示网页:Uri uri = Uri.parse("http://www.google.com");Intent it= new Intent(Intent.ACTION_VIEW,uri);startActivity(it);复制代码显示地图:Uri uri 阅读全文
posted @ 2012-02-01 21:49 灰太狼_lilongmin 阅读(174) 评论(0) 推荐(0) 编辑
摘要:http://www.eoeandroid.com/thread-61454-1-2.html 阅读全文
posted @ 2012-02-01 17:17 灰太狼_lilongmin 阅读(156) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示