上一页 1 ··· 8 9 10 11 12
  2010年12月7日
摘要: NotificationManager 和Notification的使用总结(转)文章分类:移动开发这几天一直在修改twigee的源代码,其中一个要加入的功能是常驻Notification栏,以前写的时候只能出现 在“通知”这一组中,想把它放在“正在运行”组中却不知道怎么放,查了下官方文档,找到了方法,在notification的flags字段中加一下 “FLAG_ONGOING_EVENT”就可以了。同时我也把Notification的使用方法给总结了一下。详见下文:(1)、使用系统定义的Notification以下是使用示例代码://创建一个NotificationManager的引用St 阅读全文
posted @ 2010-12-07 13:27 stay 阅读(19746) 评论(0) 推荐(1) 编辑
摘要: /** * 用来判断服务是否运行. * @param context * @param className 判断的服务名字 * @return true 在运行 false 不在运行 */ public static boolean isServiceRunning(Context mContext,String className) { boolean isRunning = false;ActivityManager activityManager = (ActivityManager)mContext.getSystemService(Context.ACTIVITY_SERVICE); 阅读全文
posted @ 2010-12-07 13:26 stay 阅读(34374) 评论(3) 推荐(0) 编辑
摘要: 转:键盘事件只会发送到当前获得焦点的View,这个KeyEvent只能被最上层获得焦点窗口的activity和view得到。一般来说这些事件会从上倒下去寻找合适的接受组件,ViewGroup的一个childView的onKeyDown()方法return true,那么表示该方法消费了此次事件,此时不会再传递到ViewGroup的onKeyDown()方法,如果onKeyDown()方法return false,那么表示该方法并未处理完全,该事件仍然需要以某种方式传递下去继续等待处理,这时传递到ActivityGroup的onKeyDown()方法。但是KeyEvent.KEYCODE_MEN 阅读全文
posted @ 2010-12-07 13:25 stay 阅读(1539) 评论(0) 推荐(0) 编辑
摘要: 取得系统时间1。long time=System.currentTimeMillis();2。final Calendar mCalendar=Calendar.getInstance();mCalendar.setTimeInMillis(time);取得小时:mHour=mCalendar.get(Calendar.HOUR);取得分钟:mMinuts=mCalendar.get(Calendar.MINUTE);3。Time t=new Time(); // or Time t=new Time("GMT+8"); 加上Time Zone资料t.setToNow(); 阅读全文
posted @ 2010-12-07 13:24 stay 阅读(64504) 评论(2) 推荐(1) 编辑
摘要: static Drawable zoomDrawable(Drawable drawable, int w, int h) { int width = drawable.getIntrinsicWidth(); int height= drawable.getIntrinsicHeight(); Bitmap oldbmp = drawableToBitmap(drawable); // drawable转换成bitmap Matrix matrix = new Matrix(); // 创建操作图片用的Matrix对象 float scaleWidth = ((float)w / width 阅读全文
posted @ 2010-12-07 13:20 stay 阅读(2376) 评论(0) 推荐(0) 编辑
摘要: android.os.Build.MODEL 手机型号android.os.Build.VERSION.SDK // android.os.Build.VERSION.SDK_INT 版本号android.os.Build.VERSION.RELEASE 版本TelephonyManager tm = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);"imsi:" + tm.getSubscriberId()"imei:" + tm.getDeviceId() 阅读全文
posted @ 2010-12-07 13:19 stay 阅读(263) 评论(0) 推荐(0) 编辑
摘要: Seek_img.xml<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"><!-- 背景图 --> <item android:id="@+android:id/background" android:drawable="@drawable/seekbar1" /> <!--全 阅读全文
posted @ 2010-12-07 13:18 stay 阅读(3633) 评论(0) 推荐(0) 编辑
摘要: 如果你把data/data/sd卡下的db文件拉出来看过,你会知道,其实设置铃声很简单,只需要更新android扫描出来的音乐文件的字段即可switch (R_id) { case R.id.set_alarms: values.put(MediaStore.Audio.Media.IS_ALARM, true); mContext.getContentResolver().update(uri, values, "_id=?", new String[]{Uri_id+""}); RingtoneManager.setActualDefaultRing 阅读全文
posted @ 2010-12-07 13:13 stay 阅读(861) 评论(0) 推荐(0) 编辑
摘要: 原创作品,转载请注明如果你做过多媒体应用,一定会苦恼过,怎样获取sd卡中的多媒体文件。android还是很强大的,如果你知道怎么调用android的api,万事就ok了。当手机或模拟器开机时,会调用android的MediaScanner,扫描sd卡和内存里的文件。以下是log信息。12-13 15:39:11.062: VERBOSE/MediaPlayerService(67): Create new media retriever from pid 34912-13 15:39:11.082: DEBUG/MediaScannerService(349): getDefaultLocal 阅读全文
posted @ 2010-12-07 13:07 stay 阅读(14437) 评论(2) 推荐(1) 编辑
摘要: * Registers a listener object to receive notification of changes* in specified telephony states.* To register a listener, pass a {@link PhoneStateListener}* and specify at least one telephony state of interest in* the events argument.* At registration, and when a specified telephony state* changes, 阅读全文
posted @ 2010-12-07 12:35 stay 阅读(1022) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12