摘要:
将一个Bitmap 的内容存到file中//create a file to write bitmap data
File f = File(context.getCacheDir(), filename);
f.createNewFile(); //Convert bitmap to byte array
Bitmap bitmap = your bitmap;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
bitmap.compress(CompressFormat.PNG, 0 /*ignored for PNG*/,. 阅读全文
阅读排行榜
Android 结束进程的方法
2012-09-06 16:50 by java20130722, 482 阅读, 收藏,
摘要:
Android 结束进程,关闭程序的方法,经过这几天的调研,发现了Android结束一个进程的方法即采用下面这个类void android.app.ActivityManager.restartPackage(String packageName)public void restartPackage (String packageName)Since: API Level 3 Have the system perform a force stop ofeverything associated with the given application package. All processes 阅读全文
xmllint: command not found
2013-03-27 15:21 by java20130722, 481 阅读, 收藏,
摘要:
在编译android source code是时候,出现如下错误:Copy xml: out/target/product/generic/system/etc/apns-conf.xml
/bin/bash: xmllint: command not found
make: *** [out/target/product/generic/system/etc/apns-conf.xml] Error 127解决方法:安装xmllint : sudo apt-get install libxml2-utils 阅读全文
python 字典
2013-06-26 11:01 by java20130722, 480 阅读, 收藏,
摘要:
python dictionary字典由对个键以及与其对应的值构成可以如下创建:>>> phonebook={'qiao':'119','lisi':'101','zhaowo':'787'}dict函数>>> items = [('name','qiaoc'),('age',26)]>>> d=dict(items)>>> d{'age': 26, 'na 阅读全文
VS2008编译的程序运行提示“由于应用程序配置不正确,应用程序未能启动”
2012-04-29 16:02 by java20130722, 477 阅读, 收藏,
摘要:
转自:http://hi.baidu.com/honfei/blog/item/2356ad9b624a01b8c9eaf485.htmlVC9编译的程序在没有装过VC9(确切的说是.Net Framework3.5)的机器上运行时,如果提示“由于应用程序配置不正确,应用程序未能启动。重新安装应用程序可能会纠正这个问题。”这个错误,那 么就说明该程序动态链接了VC9的运行时库,(如果还用到了MFC,那么可能动态链接了VC9的MFC库,同理还有ATL库),以及缺少对应的 manifest文件,程序在目标机器上没有找到这些库和配置文件,因此导致了这个错误。出现这种情况的VC9编译器可能存在3个版本 阅读全文
浙公网安备 33010602011771号