- 博客(7)
- 资源 (17)
- 问答 (3)
- 收藏
- 关注
转载 安卓按返回键让App常驻内存
@Override public void onBackPressed() { //super.onBackPressed(); /*Intent mHomeIntent = new Intent(Intent.ACTION_MAIN, null); mHomeIntent.addCategory(Intent.CATEGORY_HOME); mHomeIntent.addFla
2015-03-16 10:04:27 1561
原创 解决ListView中有Button类而失去点击事件的问题
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@null" android:orientation="vertical"
2015-03-11 11:34:08 934
转载 安卓获取控件的宽高
有两种情况:1. 当控件还未显示出来的时候,获取控件宽高的方式有:ViewTreeObserver viewTreeObserver = gv_loading.getViewTreeObserver(); viewTreeObserver.addOnPreDrawListener(new OnPreDrawListener() { @Override publi
2015-03-09 10:50:45 608
转载 dp和px的关系
dp是虚拟像素,在不同的像素密度的设备上会自动适配,比如:在320x480分辨率,像素密度为160,1dp=1px在480x800分辨率,像素密度为240,1dp=1.5px计算公式:1dp*像素密度/160 = 实际像素数px(像素):屏幕上的点。dp(与密度无关的像素):一种基于屏幕密度的抽象单位。在每英寸160点的显示器上,1dp = 1px。
2015-03-09 10:18:15 645
原创 WebView在加载完成之前显示loading图标
1.引入GifView.jar,编写xml文件:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" androi
2015-03-03 13:35:07 7485
原创 RadioGroup+RadioButton
<RadioGroup android:id="@+id/rg_bottom" android:paddingBottom="10dp" android:paddingTop="10dp" android:layout_width="match_parent" android:layout_height="wrap_c
2015-03-03 10:23:51 454
转载 在service代码里实现广播接收者
service里:// 初始化广播接收器 private MyBroadcastReceiver receviver = null; private void initBroadcastReceiver() { // 创建一个IntentFilter对象,将其action指定为BluetoothDevice.ACTION_FOUND IntentFilter intentFilt
2015-03-03 09:13:46 2543
TA创建的收藏夹 TA关注的收藏夹
TA关注的人