一些API的使用
来源:互联网 发布:淘宝要不要买旺铺 编辑:程序博客网 时间:2024/05/21 08:50
Paint paint = new Paint(); // setColor 须在 setAlpha 方法之前设置,原因请参见 Android API paint.setColor(Color.GRAY); // 值越大越不透明 paint.setAlpha(255);
//取得屏幕分辨率DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm);
// 去掉标题栏requestWindowFeature(Window.FEATURE_NO_TITLE);
// 设置为全屏getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
// 如何一个 service 被调用很多次,即 onStartCommand() 响应过很多个请求,// 那么会相应的产生很多个 startId,比如:1,2,3 三个// 那么,stopSelfResult(int startId) 只会在参数为 3 的时候才会真正地停止这个服务// 另外,stopSelf() 是stopSelfResult()的老版本,推荐使用新版本boolean result = stopSelfResult(msg.arg1);
/** * Show a notification while this service is running. */ private void showNotification() { // In this sample, we'll use the same text for the ticker and the expanded notification CharSequence text = getText(R.string.local_service_started); // Set the icon, scrolling text and timestamp Notification notification = new Notification(R.drawable.stat_sample, text, System.currentTimeMillis()); // The PendingIntent to launch our activity if the user selects this notification PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, LocalServiceActivities.Controller.class), 0); // Set the info for the views that show in the notification panel. notification.setLatestEventInfo(this, getText(R.string.local_service_label), text, contentIntent); // Send the notification. // We use a layout id because it is a unique number. We use it later to cancel. mNM.notify(R.string.local_service_started, notification); }
0 0
- 一些API的使用
- 使用mysql++ 的一些api
- 一些简单的API的使用
- VB中一些API的使用
- MFC vc++ 一些 API 的使用
- GCD中一些API的使用
- 百度地图API使用的一些注意事项
- snmp的学习与snmp4j的一些api使用
- 一些常用的API
- js的一些api
- XCode的一些API
- 一些常用的API
- jQuery的一些API
- 一些免费的API
- 一些常用的API
- 一些有用的API
- BCB的一些API
- 对象的一些API
- redis 主从 配置和哨兵监控
- REST技术第四步 多个参数注解问题
- [资源贴] AChartEngin -Android 图形化报表 插件
- CodeForces 461A Appleman and Toastman
- Android开发笔记(四十七)Runnable接口实现多线程
- 一些API的使用
- no visible @interface for declares
- 遮挡剔除(Occlusion Culling)与视锥体剔除(Frustum Culling)是否可以同时起作用?()
- APUE学习笔记【3】
- 近期安排
- python基础:python的局部变量和全局变量
- openssl rsa
- 关于学程序需不需要学习英语的忠告
- 208,使用#define宏定义简化代码