对于自定义view 想动态修改里面的属性:<com.xxx.android.components.TopMenu
android:layout_width="fill_parent"
android:layout_height="44dp"
/>
如果你开始是<com.xxx.android.components.TopMenu />
然后想变成上面的样子加上宽度和高度之类的属性不能用set LayoutParams

而可以在onFinishInflate() 中设置

2.让一个对话框无标题栏

Dialog dialog = new Dialog(this, android.R.style.Theme_Translucent_NoTitleBar);

3. 关系自动提示EditText

EditText txtTypeIt = (EditText) this.findViewById(R.id.txtTypeIt); txtTypeIt.setInputType(524288);

4.远端下载图片

http://www.anddev.org/gallery_with_remote_images-t769.html

5.程序安装完 自动启动 不是运行一次后每次自动启动通过BOOT_COMPLETED ,这种方法目前还没有实现智能通过间接方法

SharedPreferences prefs = getPreferences(MODE_PRIVATE); if (!prefs.contains(KEY_FIRST_RUN)) {     /* do some one-off stuff here */     prefs.edit().putBoolean(KEY_FIRST_RUN, false).commit(); } 

每次进行检查。

6.如果SMS超过了160x3 characters 他会自动转换成MMS 在模拟机上

7.在EditViewView中显示时间

EditText editText = (EditText) findViewById( R.id.your_edittext_id );

SimpleDateFormat sdf = new SimpleDateFormat( "yyyy/MM/dd" );
editText
.setText( sdf.format( new Date() ));

8.去除背景色 可以考虑使用一下

android:background="@android:color/transparent"

9.SimpleCursorAdapter sca = new SimpleCursorAdapter(this, R.layout.log_item,c,new String[] {DBAdapter.KEY_LOG_TRIPDATE, DBAdapter.KEY_FOO, DBAdapter.KEY_BAR},new int[]{R.id.txtTripDate, R.id.otherid1, R.id.otherid2});

更多相关文章

  1. 安卓中的布局属性详解
  2. Android(安卓)弹出对话框Dialog
  3. android EditText 如何限制只能输入指定的字符
  4. Android(安卓)EditText无边框问题
  5. [Android学习]ImageView的scaletype属性
  6. Android(安卓)Launcher label和Main Activity保持不一致
  7. Android(安卓)相对布局常用属性
  8. android布局属性详解
  9. Android平台常见属性集合

随机推荐

  1. IPC—进程间通信的基础概念--《Android开
  2. 【Android学习笔记】再探Android(安卓)Se
  3. Android(安卓)SDK安装
  4. Android入门教程(五)之------第一个Andro
  5. Android创建和使用数据库详…
  6. EditText横屏时,弹出软件盘时不进行全屏
  7. [Java][Android][Process] 暴力的服务可
  8. android 布局中 layout_gravity、gravity
  9. Android面试题收集(有具体答案)
  10. Android及Robotium学习总结【环境…