public class MemoryManager {
private static final String TAG = "MemoryManager";
private static final int MAXMEMORY=50*1024*1024;//程序运行的最大内存
/**
* 判断系统是否在低内存下运行
* @param context
* @return
*/...
分类:
移动开发 时间:
2015-01-11 09:46:22
阅读次数:
201
项目开发过程中,
private static boolean XMLPost(String content, String sendUrl) throws Exception{
boolean bn = false;
if ( null != content ) {
//初始假设请求发送失败,等待正常返回200后再将失败记录数--
CommonU...
分类:
编程语言 时间:
2015-01-09 15:42:31
阅读次数:
219
Application 中 private RequestQueue mRequestQueue;
private static AppController mInstance;
@Override
public void onCreate() {
super.onCreate();
mInstance = this;
}
/**
* 锁定的是本类
*
* @r...
分类:
其他好文 时间:
2015-01-09 14:23:58
阅读次数:
108
1.首先引用dll文件2.//DBAccess.dll引用一個dll文件 private IDBAccess _access; private static readonly string mySqlConnectionString = System.Configuration.Configurat...
分类:
数据库 时间:
2015-01-09 12:04:38
阅读次数:
186
C# Codepublic class TestClass{ private static string Str = string.Empty; public TestClass() { if (string.IsNullOrEmpty(Str)) { ...
写在前面最近一个月一直在弄文件传输组件,其中用到多线程的技术,但有的地方确实需要只能有一个线程来操作,如何才能保证只有一个线程呢?首先想到的就是锁的概念,最近在我们项目组中听的最多的也是锁谁,如何锁?看到有同事使用lock(this),也有lock(private static object),那就...
/** * 获取状态栏的高度 * @param context * @return */private static int getStatusHeight(Context context){ int statusHeight = 0; Rect localRect = new Rect(); ((Activity) context).getWindow().getDecorView().getW...
分类:
移动开发 时间:
2015-01-08 13:30:18
阅读次数:
228
今天碰到一个问题,我的一个工具类提供了几种静态方法,静态方法需要另外一个类的实例提供处理,因此就写出了这样的代码:Class Util{ private static XXX xxx; xxx = BeanUtil.getBean("xxx"); public static void meth...
分类:
编程语言 时间:
2015-01-08 09:36:01
阅读次数:
253
人民币转换 1 package t0107; 2 3 public class Money { 4 5 private static final char[] data = new char[]{ 6 '零','壹','贰','叁','肆','伍','陆','柒','捌'...
分类:
其他好文 时间:
2015-01-07 21:53:46
阅读次数:
163
下面是简单的流程图,从java到kernel层。
ShutdownThread.java文件
stop playing music,因为后面可能要playing shutdown music.
代码如下:
private static void beginShutdownSequence(Context context) {
....
...
分类:
移动开发 时间:
2015-01-07 20:54:18
阅读次数:
479