1. 2. MultiAutoCompleteTextView textView = ( MultiAutoCompleteTextView ) findViewById ( R.id.editText1 ); textView.setAdapter ( adapter ); // 设置多个值...
分类:
移动开发 时间:
2015-03-09 14:24:55
阅读次数:
135
[java]view plaincopyprint?//取得Intent中的頭像ivShowImage=(ImageView)findViewById(R.id.call_log_detail_contact_img);//通话电话号码获取头像uriUriuriNumber2Contacts=Uri...
分类:
移动开发 时间:
2015-03-09 12:15:36
阅读次数:
128
框架地址:https://github.com/wyouflf/xUtils
作用:
完全注解方式就可以进行UI绑定和事件绑定。无需findViewById和setClickListener等。...
分类:
移动开发 时间:
2015-03-08 14:20:27
阅读次数:
132
1.效果图 点击链接并且可以跳转到响应的网页中去2. 实现代码 textView1 = ( TextView ) this.findViewById ( R.id.textview1 ); textView2 = ( TextView ) this.findViewById ( R.id....
分类:
移动开发 时间:
2015-03-06 10:35:56
阅读次数:
216
1如果一个自定义view要在短时间被多次调用,会造成多次读取xml和findViewById,所以动态添加控件、属性RelativeLayout: private void initView() { Button btn1 = new Button(this.getContext())...
分类:
其他好文 时间:
2015-03-02 22:14:47
阅读次数:
283
1、
直接通过id查找后,绑定匿名内部类作为事件监听类。代码如下:
Button loginButton = (Button) findViewById(R.id.tologin1);
btn1.setOnclickListener(new OnclickListener(){
public void onClick(View v){
// 要...
分类:
移动开发 时间:
2015-03-02 16:55:04
阅读次数:
202
// 自动补齐的TextViewAutoCompleteTextView mPlace = (AutoCompleteTextView)findViewById(R.id.autoCompleteTextView1);String[] books = new String[] { "rollen",...
分类:
移动开发 时间:
2015-03-01 10:19:25
阅读次数:
169
Android LayoutInflater 详解
简介:
在实际开发中LayoutInflater这个类还是非常有用的,它的作用类似于findViewById()。不同点是LayoutInflater是用来找res/layout/下的xml布局文件,并且实例化;而findViewById()是找xml布局文件下的具体widget控件(如Button,TextView等等)。使用场景:
①对于一个没...
分类:
移动开发 时间:
2015-03-01 01:33:04
阅读次数:
165
一 src目录
src是项目的Java源代码
onCreate(Bundle)
初始化活动(Activity),比如完成一些图形的绘制。
最重要的是,在这个方法里用布局资源(layout resource)调用setContentView(int)方法定义UI,
用findViewById(int)在UI中检索需要编程交互的小部件(widgets)。
setContentView指定由...
分类:
移动开发 时间:
2015-02-27 20:17:13
阅读次数:
200
1 gridView = (GridView) getView().findViewById(R.id.gridView_musicbook); 2 3 gridView.getViewTreeObserver().addOnGlobalLayoutListene...
分类:
移动开发 时间:
2015-02-27 20:08:50
阅读次数:
136