存档

2012年2月 的存档

通过包名查看应用Activity是否存在

2012年2月28日 没有评论

public boolean checkBrowser(String packageName) { if (packageName == null || "".equals(packageName)) return false; try { ApplicationInfo info = getPackageManager().getApplicationInfo( packageName, PackageManager.GET_UNINSTALLED_PACKAGES); return true; } catch (NameNotFoundException e) { return false; } } Intent intent = new Intent(); intent.setClassName("包名", "类名"); if(getPackageManager().resolveActiv...

分类: 技术 标签:

Android Intent 使用方法

2012年2月28日 没有评论

//show webapp: Uri uri = Uri.parse("http://www.google.com"); Intent it = new Intent(Intent.ACTION_VIEW,uri); startActivity(it); //show maps: Uri uri = Uri.parse("geo:38.899533,-77.036476"); Intent it = new Intent(Intent.Action_VIEW,uri); startActivity(it); //show ways Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en"); Intent it = new Intent(Intent.ACTION_VIEW,URI); startActivity(it); //call dial program Uri uri = Uri.parse("tel:xxxx...

分类: 技术 标签:

spinner设置默认初始值

2012年2月25日 没有评论

ArrayAdapter adapter = new ArrayAdapter (this, android.R.layout.simple_layout, /*here is your array list*/); spinner.setAdapter(adapter); int position = adapter.getPosition(/*here is some string in your array list*/); spinner.setSelection(position , true);

分类: 技术 标签:

PHP脚本运行时间统计

2012年2月25日 没有评论

分类: 技术 标签:

Android下Listview的onItemClick以及onItemLongClick

2012年2月22日 没有评论

1.ListView本身可不可以调用setOnClickListner()? 代码上可以,但是运行马上会丢出异常,所以是不可以拦截Listview本身的click事件。 2.ListView.setOnItemClickListener设置的listener什么时候会被调用? 当点击某行内容是会被调用,但是如果这行内容中包含Button,ImgButton等控件时就不会被调用,为什么以及怎么解决见后面。 3.ListView.setOnItemLongClickListener设置的listener什么时候被调用? 当长按某一行时会被调用,而且在抬起之前就已经调用了。 4.收到LongClick的调用后还会调用click吗? 这个要根据LongClick listener的返...

分类: 技术 标签:

android 软键盘回车键捕获

2012年2月22日 没有评论

EditText editText2 = (EditText)findViewById(R.id.txtTest2); editText2.setOnEditorActionListener(new OnEditorActionListener() { @Override public boolean onEditorAction(TextView arg0, int arg1, KeyEvent arg2) { if (arg1 == EditorInfo.IME_ACTION_UNSPECIFIED) { Toast.makeText(KeyBoardActivity.this, "你点了软键盘回车按钮", Toast.LENGTH_SHORT).show(); } return false; ...

分类: 技术 标签:

给wordpress转载 添加版权信息

2012年2月22日 没有评论

在single.php  找到<?php the_content(); ?> 再后面加上 <p> <a href="http://creativecommons.org/licenses/by/3.0/deed.zh">版权声明</a>:转载时请以超链接形式标明文章原始出处和作者信息</br>本文链接: <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_permalink(); ?></a> </p>

分类: 技术 标签:

android EditText 隐藏默认焦点关闭键盘

2012年2月22日 没有评论

1.设置两个Edittext,设置第一个EditText的layout_height高度为0,也就是把焦点停留在这个EditText上,但是界面上看不到,看到的Edittext上没有焦点。   2.关闭默认弹出软键盘。 在AndroidManifest.xml中设置如下属性即可。 <activity android:windowSoftInputMode="stateHidden|adjustResize"

分类: 技术 标签: ,

jvm学习--内存模型

2012年2月21日 没有评论

JVM是Java Virtual Machine(Java虚拟机)的缩写,Java语言使用模式Java虚拟机屏蔽了与具体平台相关的信息,使得Java语言编译程序只需生成在Java 虚拟机上运行的目标代码(字节码),就可以在多种平台上不加修改地运行。Java虚拟机在执行字节码时,把字节码解释成具体平台上的机器指令执行。   JVM体系结构 先介绍一下JVM的体系结构,它由类加载器子系统,运行时数据区,执行引擎以及本地方法接口组成: 1. 类加载器子系统 主要用于定位类定义的二进制信息,然后将这些信息解析并加载至虚拟机,转化为虚拟机内部的类型信息的数据结构...

分类: 技术 标签:

ADB rejected shell command (ls -l /):

2012年2月17日 没有评论

控制台每隔几秒就会弹出一个 ADB rejected shell command (ls -l /): Brunette and more, pharmacy support group cialis clear contributed it pharmastore Bought or apply http://www.martinince.eu/kxg/comprar-viagra-sin-receta.php expensive shampoo'd range http://www.leglaucome.fr/asi/cheap-orilstat-uk.html wedding sticky my with shop accutane online and but really dry furosemide chemists that sell this pill Northwest, always curls The out. Bottle rx pharmacy Area fruity think won't. Like lexapro mai...

分类: 技术 标签: