07 2011 档案
摘要:数据线丢了,不想花钱去买,在网上看了看,android手机居然可以通过wifi进行程序的调试,太好了,自己搞了一下,虽然网上写的很详细,但是还是有些问题,记录下来,下次参考。 1.首先让android手机监听指定的端口: 这一步需要使用shell,因此手机上要有终端模拟器,不过网上很多,随便找个就行了,依次敲入下列几行: 1 su//获取root权限 2 setprop service.adb.t...
阅读全文
摘要:有时text view或者button的click方法会失效,咋办?答案是在被测程序的AndroidManifest.xml文件里加上这么一句:<supports-screens android:anyDensity="true"/>就行了
阅读全文
摘要:今天在写单元测试代码的时候需要这样一个问题, 运行的时候提示Test run failed: Test run incomplete. Expected 1 tests, received 0。 后来找到是构造函数的事,于是把泛型去掉, 然后用不带参数的构造函数,在构造函数里调用super(“com.xxx.xxx”, Activity.class); 就Ok了。
阅读全文
摘要:在res/drawable文件夹新增一个文件,此文件设置了图片的触发状态,你可以设置 state_pressed,state_checked,state_pressed,state_selected,state_focused,state_enabled 等几个状态: < selector xmlns:android="http://schemas.android.com/apk/res/andr...
阅读全文
摘要:Touch事件在 onInterceptTouchEvent()和onTouchEvent以及各个childView间的传递机制完全取决于onInterceptTouchEvent()和onTouchEvent()的返回值。返回值为true表示事件被正确接收和处理了,返回值为false表示事件没有被处理,将继续传递下去(只是传递方向不一样,onInterceptTouchEvent()向子View...
阅读全文
摘要:<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/> Intent shortcutIntent = new Intent("com.android.launcher.action.INSTALL_SHORTCUT"); shortcutIntent.putExtra(Intent....
阅读全文
摘要:TextView nullTxtView=new TextView(this); nullTxtView.setText("这里为空哈哈"); nullTxtView.setGravity(Gravity.CENTER); listView.setEmptyView(nullTxtView); LayoutParams params = new LayoutParams(LayoutParams....
阅读全文
浙公网安备 33010602011771号