摘要:
现在每天都在忙,而且一忙起来,就把写笔记的事情放在了后面,最近在写程序的时候,突然要使用全局变量,就按照以前的方式,写了一个类,然后把变量都声明为静态变量,然后做为全局变量使用,但是在进行Activity切换的时候,突然发现,在前面一个Acitivty中赋值后,但是在后面却无法获取到,刚开始以为是有其它地方有问题,但是后来检查发现也没有问题,这个问题困扰了一个来小时,后来又换一种写法,就是使用Application,但是在使用的时候,也发现有这种问题,当时真是感觉不知道如何处理了,在网上查资料也没有看到怎么解决! 在最后我又把初始化换了一个地方进行测试,这次赋值居然不消失了,不过这时还不明白. 阅读全文
摘要:
ImageView是Android程序中经常用到的组件,它将一个图片显示到屏幕上。在UI xml定义一个ImageView如下:public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.myimage); ImageView image1 = (ImageView) findViewById(R.myImage.image); //Bitmap bitmap = getLoacalBitmap("/aa/aa.jpg&quo 阅读全文
摘要:
在Android中显示一张网络图片其实是超级简单的,下面就一个非常简单的例子:Step1:1、创建你的Activity,本例中以ViewWebImageActivity说明;2、ViewWebImageActivity中的代码如下:String imageUrl = "http://hiphotos.baidu.com/baidu/pic/item/7d8aebfebf3f9e125c6008d8.jpg"; //这就是你需要显示的网络图片---网上随便找的Bitmap bmImg; ImageView imView; Button button1; @Override p 阅读全文
摘要:
//高亮显示搜索到的关键字function HeightLight(Keyword){ //文本选择器 var TextRange; //是否找到 var Found=false; //找到的次数 var Count = 0; TextRange = document.body.createTextRange(); Found = TextRange.findText(Keyword); if (Found) { Count++; } while (Found && Count > 0) { TextRange.pasteHTML('<span style= 阅读全文
摘要:
step 1 - create a new console applicationThen extract theLucene.Net.dllfrom theApache-Lucene.Net-2.9.2-incubating.bin.zipfile into yourlibfolder.You'll notice lots of other bits in this zip file. Especially of interest to you later might be the stuff in thecontribfolder. I might get to that in a 阅读全文