杂选 DbUtils的注释,注册上下文菜单,图像适配,控件隐藏

来源:互联网 发布:淘宝购物返利 编辑:程序博客网 时间:2024/05/19 05:32

@unique    确保元素的不重复性

@SerializedName("关键字")  关键字作为key的办法


注册上下文对象

在获得空间后注册


// 注册gvregisterForContextMenu(gv_listMy);

//在类中

// 创建上下文菜单方法@Overridepublic void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {// 手动创建menu.add(0, 1, 0, "删除");super.onCreateContextMenu(menu, v, menuInfo);}// 上下文菜单被选中时调用的方法@Overridepublic boolean onContextItemSelected(MenuItem item) {// 如何知道点的是gv中的哪一个AdapterContextMenuInfo menuInfo = (AdapterContextMenuInfo) item.getMenuInfo();int position = menuInfo.position;switch (item.getItemId()) {case 1:System.out.println("选中了第" + position + "项");break;default:break;}return super.onContextItemSelected(item);}// 上下文菜单关闭时选中的方法private void getData() {dbUtils = DbUtils.create(context);// 查询存储的数据selectData();}


把某个字符串用指定字符集解码

URLEncoder.encode("aa", "utf-8");

图片可以设置的属性,⑩它更加好看

android:scaleType="fitXY"

控件设置的属性 隐藏 显示 不占空间

android:visibility="invisible"

碎片的动画

beginTransaction.setCustomAnimations(R.anim.enter_in_from_right,R.anim.enter_out_from_left, R.anim.enter_in_from_left,R.anim.enter_out_from_right);

EditText的输入类型,无下滑线



android:inputType="number"// 数字android:inputType="textPassword"// 密码android:inputType="phone"//电话android:background="@null"// 无下划线

1 0
原创粉丝点击