按钮圆角 |
android |
|
GradientDrawable drawable = new GradientDrawable();
drawable.setColor(cssTable_.getBackgroundColor(Color.TRANSPARENT));
drawable.setCornerRadius(3);
button.setBackgroundDrawable(drawable);
|
ListView上面有需要点击的图片 |
android |
|
public class DontPressWithParentCheckBox extends CheckBox
{
public DontPressWithParentCheckBox(Context context, AttributeSet attrs)
{
super(context, attrs);
}
@Override
public void setPressed(boolean pressed)
{
// 如果父控件按下,不予处理.
if (pressed && ((View) getParent()).isPressed())
{
return;
}
super.setPressed(pressed);
}
}
|
获取IMEI手机号 |
android |
iteye |
TelephonyManager tm = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
String imei = tm.getDeviceId();
String tel = tm.getLine1Number();
|
不弹出键盘 |
android |
百度 |
mUserId.setInputType(InputType.TYPE_DATETIME_VARIATION_NORMAL);
|
布局分隔线 |
android |
|
<View
android:layout_width="fill_parent"
android:layout_height="1px"
android:background="?android:attr/listDivider"
/>
|
模拟按键 |
android |
网上找的 |
/**
* 模拟按键
* @param keyCode
*/
public void simulateKeyEvent(final int keyCode)
{
new Thread()
{
public void run()
{
Instrumentation inst = new Instrumentation();
inst.sendKeyDownUpSync(keyCode);
}
}.start();
}
|