1.日期选择控件DatePickerDialog代码: 1 btnChooseDate=(Button) findViewById(R.id.btnChooseDate); 2 btnChooseDate.setOnClickListener(new OnClickL...
分类:
移动开发 时间:
2015-07-14 17:51:30
阅读次数:
126
一 旋转动画1、定义一个ImageView定义一个ImageView是为了装载图片,其中的图片将被rotate用来进行旋转,其他View亦可。资源文件为 ImageView infoOperatingIV = (ImageView)findViewById(R...
分类:
移动开发 时间:
2015-07-14 16:59:08
阅读次数:
161
audiofocus试验:
使用soundPool来写一个播放音频的porject.
资源初始化:setContentView(R.layout.activity_main);
Button bt1 = (Button)findViewById(R.id.bt1);
Button bt2 = (Button)findViewById(R.id.bt2);...
分类:
其他好文 时间:
2015-07-14 15:43:35
阅读次数:
94
1.修改TextView字体mTextView = (TextView) findViewById(R.id.textview1);mTextView.setText("I am here");Resources resources = getBaseContext().getResources()...
分类:
移动开发 时间:
2015-07-11 17:57:10
阅读次数:
152
在我们进行android开发的时候,经常遇到一些回调函数,其中,我们最常用的回调就是,当我们对一个组件设置监听的时候,其实就相对于设置的回调函数。例如:Button btn = (Button)findViewById(R.id.btn);btn.setOnClickListener(new Button.OnClickListener(){//创建监听
public...
分类:
移动开发 时间:
2015-07-11 09:10:40
阅读次数:
190
在实际开发中LayoutInflater这个类还是非常有用的,它的作用类似于findViewById()。不同点是LayoutInflater是用来找res/layout/下的xml布局文件,并且实例化;而findViewById()是找xml布局文件下的具体widget控件(如Button、Tex...
分类:
移动开发 时间:
2015-07-09 16:03:10
阅读次数:
142
拨打电话:权限:EditText text=(EditText)findViewById(R.id.txtphone);String phone=text.getText().toString();Intent intent=new Intent();intent.setAction(Intent....
分类:
移动开发 时间:
2015-07-09 12:37:05
阅读次数:
110
WebView是View的一个子类,可以让你在activity中显示网页。 可以在布局文件中写入WebView:比如下面这个写了一个填满整个屏幕的WebView: 加载一个网页,使用loadUrl():WebView myWebView = (WebView) findViewById(R....
分类:
Web程序 时间:
2015-07-09 11:09:51
阅读次数:
219
给一个按钮添加onclick事件 //获取按钮对象 Button Aiyo = (Button)findViewById(R.id.button1); Aiyo.setOnClickListener(new OnClickListener() { ...
分类:
移动开发 时间:
2015-07-08 18:04:00
阅读次数:
136
1.EditText 中将光标移到文字末尾:1 EditText mEdit = (EditText)this.findViewById(R.id.EditText01);2 mEdit .setText("abcdefg");3 Editable b = mEdit .getText();4 mE...
分类:
移动开发 时间:
2015-07-08 14:22:42
阅读次数:
143