摘要: 1、配置AndroidManifestAndroid项目添加单元测试,需要在AndroidManifest.xml中做一些配置: <instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="com.example.apptest" android:label="unit test"> </instrumentation>这里,把包名替换成Android项目的就行。在Applicatio 阅读全文
posted @ 2013-06-03 16:39 云海天际 阅读(373) 评论(0) 推荐(0) 编辑
摘要: private static int getStatusBarHeight(Context context) { Class<?> c; Object obj; Field field; int x; try { c = Class.forName("com.android.internal.R$dimen"); obj = c.newInstance(); field = c.getField("status_bar_height"); x = Integer.parseInt(field.get(obj).toString()); ret 阅读全文
posted @ 2013-06-03 16:19 云海天际 阅读(229) 评论(0) 推荐(0) 编辑