摘要: 一、在程序当前目录下读写文件1、将Textiew或Editiew的内容写入文件中....write(et1.getText().toString());//et为EditText,即调用write(String),目标文件在write()中...protected void write(String Content) { // TODO Auto-generated method stub try{ String name=et2.getText().toString()+".txt";//目标文件为name.txt FileOutputStream out = openF 阅读全文
posted @ 2013-08-18 13:25 行云有影 阅读(239) 评论(0) 推荐(0)
摘要: (一):使用ArrayAdapter进行适配数据:private Spinner spinner;//声明下拉列表...String[] m={"武汉","上海","台湾"};//数组作为下拉列表项spinner=(Spinner)findViewById(R.id.spinner1); ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout.simple_spinner_item,m); //数组下拉列表适配器 spinner.setAdapter(adapter) 阅读全文
posted @ 2013-08-17 17:23 行云有影 阅读(333) 评论(0) 推荐(0)
摘要: 一、使用AlertDialog.Builder创建对话框需要了解以下几个方法:setTitle :为对话框设置标题setIcon :为对话框设置图标setMessage:为对话框设置内容setView : 给对话框设置自定义样式setItems & setSingleChoiceItems:设置对话框要显示的一个list,一般用于显示几个命令时setMultiChoiceItems :用来设置对话框显示一系列的复选框setNeutralButton :普通按钮setPositiveButton :给对话框添加"Yes"按钮setNegativeButton :对话框 阅读全文
posted @ 2013-08-15 23:05 行云有影 阅读(494) 评论(0) 推荐(0)
摘要: 1、通过Intent,在Activity01中调起OtherActivity,并向OtherActivity传递某个信息Intent intent = new Intent();intent.setClass(Activity01.this, OtherActivity.class);//指出是哪个Activity,setClass(对象,类),对于嵌套类,为了提供良好的阅读方式并避免奇异,我们都指明是哪个类startActivity(intent); //启动另外的Activity,作为View的方法,可以直接使用startActivity,由于嵌套类,这样些可以清晰一些。给Intent添加 阅读全文
posted @ 2013-08-14 11:19 行云有影 阅读(566) 评论(0) 推荐(0)
摘要: 为文本指定特定的软键盘类型:android:inputType="textPhonetic"--拼音输入格式android:inputType="textPassword"--密码格式android:inputType="number"--数字格式输入框获取焦点:(其实只要是View都支持这个方法)... 阅读全文
posted @ 2013-08-12 14:08 行云有影 阅读(318) 评论(0) 推荐(0)
摘要: 1、添加Textiew组件后修改其属性: (1)XML文件修改: android:textColor="#ff0000" //字体红色 android:textSize="24sp" //字体大小 android:textStyle="bold" //粗体 (2)修改java代码实现 TextVie 阅读全文
posted @ 2013-08-12 13:35 行云有影 阅读(409) 评论(0) 推荐(0)
摘要: 升级文件名 → update作用: 刷入ROM 列句: fastboot update update.zip刷入所有镜像 → flashall作用: 刷入boot.img、system.img、recovery.img 列句: fastboot flashall update.zip刷入镜像 → flash作用: 刷入boot.img、system.img、recovery.img 列句: fastboot flash system system.img擦除镜像 → erase作用: 擦除boot.img、system.img、recovery.img 列句: fastboot erase b 阅读全文
posted @ 2013-08-10 20:41 行云有影 阅读(20194) 评论(0) 推荐(0)
摘要: 1、xml中"Composite"-->WebView2、基本应用:实例化一个WebView,并显示网页。public class MainActivity extends Activity {private WebView webView1;protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); webView1=(WebView)findViewBy... 阅读全文
posted @ 2013-08-10 14:58 行云有影 阅读(207) 评论(0) 推荐(0)
摘要: 代码如下:String cmd = "su -c reboot";//su -c reboot recovery//su -c reboot bootloader try { Runtime.getRuntime().exec(cmd); } catch (IOException e) { // TODO Auto-generated catch block ... 阅读全文
posted @ 2013-08-09 16:54 行云有影 阅读(253) 评论(0) 推荐(0)
摘要: 1、xml添加一个listview控件:composite--->ListView(id:listView1)2、初始化:private ListView listView;listView = (ListView) view.findViewById(R.id.listView);给ListView加入数据(适配器):File file = new File(sDir); final String[] m=file.list();ArrayAdapter adapter = new ArrayAdapter(this.getActivity(), android.R.layout.si 阅读全文
posted @ 2013-08-09 16:47 行云有影 阅读(312) 评论(0) 推荐(0)