安卓笔记
文章平均质量分 57
骑着单车去追梦
多学一点知识,少写一行代码。
展开
-
android 调用第三方应用
方法一: Intent intent = new Intent(); ComponentName comp = new ComponentName("com.cn.test", "com.cn.test.LoginActivity"); intent.setComponent(comp); intent.se原创 2013-11-26 14:01:21 · 663 阅读 · 0 评论 -
开源项目介绍
项目篇:1.Apollo音乐播放器就一个很好的播放器,但是实现的特别好!!!地址:https://github.com/Splitter/android_packages_apps_apolloMod2.Oschina客户端OSChina网站客户端,wp版,ios版都有开源哦。地址:https://github.com/osc转载 2014-08-22 15:16:24 · 1478 阅读 · 0 评论 -
ImageView 等比例放大
ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:scaleType="fitCenter" android:src="@drawable/exam_head" />复制代原创 2014-08-22 08:52:18 · 1107 阅读 · 0 评论 -
Android Animation学习(二) ApiDemos解析:基本Animatiors使用
Android Animation学习(二) ApiDemos解析:基本Animators使用 Android Animation(二)学习 ApiDemos解析:基本Animatiors使用 Animator类提供了创建动画的基本结构,但是一般使用的是它的子类: ValueAnimator、ObjectAnimator、AnimatorSet转载 2014-08-21 17:16:49 · 713 阅读 · 0 评论 -
Android锁屏状态下弹出activity,如新版qq的锁屏消息提示
在接收消息广播的onReceive里,跳转到你要显示的界面。如:Intent intent = new Intent(arg0,MainActivity.class);intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); arg0.startActivity(intent);复制代码在该acti转载 2014-08-22 08:46:00 · 989 阅读 · 0 评论 -
android如何保证service不被杀死
Android开发的过程中,每次调用startService(Intent)的时候,都会调用该Service对象的onStartCommand(Intent,int,int)方法,然后在onStartCommand方法中做一些处理。从Android官方文档中,我们知道onStartCommand有4种int返回值,首先简单地讲讲int返回值的作用。一、onStartComman转载 2013-12-04 16:04:51 · 918 阅读 · 0 评论 -
android Service 启动讲解
有了 Service 类我们如何启动他呢,有两种方法:• Context.startService()• Context.bindService() 1. 在同一个应用任何地方调用 startService() 方法就能启动 Service 了,然后系统会回调 Service 类的 onCreate() 以及 onStart() 方法。这样启动的 Service 会一直运转载 2013-12-04 16:50:14 · 787 阅读 · 0 评论 -
android 检查service是否停止
/** * 用来判断服务是否运行. * @param context * @param className 判断的服务名字 * @return true 在运行 false 不在运行 */ public static boolean isServiceR转载 2013-12-02 14:33:45 · 960 阅读 · 0 评论 -
如何安装开发环境
111原创 2013-11-28 13:03:53 · 711 阅读 · 0 评论 -
android 屏蔽home键
private static final int FLAG_HOMEKEY_DISPATCHED = 0x80000000; 在app 的你要屏蔽home 键的activity 中,只需要添加该标志就可以了 getWindow().addFlags(WindowManager.LayoutParams.FLAG_HOMEKEY_DISPATCHED); 如果要使转载 2013-11-28 14:05:19 · 1453 阅读 · 0 评论 -
Android 闹钟机制实现定时任务解决重启失效问题
Android的闹钟实现机制很简单, 只需要调用AlarmManager.set()将闹铃时间记录到系统中,当闹铃时间到后,系统会给应用程序发送广播,我们只需要去注册广播接收器就可以了。本文分三部分讲解如何实现闹钟:目录:1. 设置闹铃时间;2. 接收闹铃事件广播;3. 重开机后重新计算并设置闹铃时间;正文:1. 设置闹铃时间(毫秒) privat转载 2013-11-27 14:57:27 · 4723 阅读 · 0 评论 -
android 如何退出整个系统
package com.example.startotherapp;import java.util.LinkedList;import java.util.List;import android.app.Activity;import android.app.Application;public class MyApplication extends原创 2013-11-26 18:59:43 · 874 阅读 · 0 评论 -
android 通用的跳转函数Intent
//大家再也不用每个activity 都写Intent跳转了: 注释:intent 在你要跳转的函数中创建; forwordActivityClass 你要跳转的页 finishSign 是否结束标识public void turnActivity(Intent intent, Context ct , Class for原创 2013-11-26 19:15:39 · 1008 阅读 · 0 评论 -
android 崩溃 重启 捕获异常 并重启应用
推荐方法: public class HKApplication extends Application { PendingIntent restartIntent; @Override public void onCreate() { super.onCreate(); // 以下用来捕转载 2013-11-26 13:54:15 · 797 阅读 · 0 评论 -
Android OnLowMemory和OnTrimMemory
OnLowMemoryOnLowMemory是Android提供的API,在系统内存不足,所有后台程序(优先级为background的进程,不是指后台运行的进程)都被杀死时,系统会调用OnLowMemory。系统提供的回调有:Application.onLowMemory()Activity.OnLowMemory()Fragement.OnLowM转载 2013-11-26 18:55:31 · 1660 阅读 · 0 评论 -
android View的生命周期
构造-onAttachToWindow——>onMeasure——>onSizeChanged——>onLayout——> onMeasure——>onLayout——>onDraw——>onDetachedFromWindow原创 2014-08-28 15:28:21 · 674 阅读 · 1 评论