Android 弹出二选一窗口的实现 及Serializable
来源:互联网 发布:概率中a的算法 编辑:程序博客网 时间:2024/05/16 07:07
public void save() {@SuppressWarnings("rawtypes")File file = new File(SYSSETPATH);if (file.exists())file.delete();try {ObjectOutputStream objOutPutStream = new ObjectOutputStream(new FileOutputStream(file));objOutPutStream.writeObject(mSystemSet);objOutPutStream.close();} catch (FileNotFoundException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();}}
protected void onExit() {new AlertDialog.Builder(this).setTitle(getString(R.string.dlg_title)).setMessage(getString("确定要退出吗?")).setPositiveButton(getString(R.string.yes),new DialogInterface.OnClickListener() {@Overridepublic void onClick(DialogInterface dialog,int which) {setResult(Msg.SYSTEMEXIT);finish();}}).setNegativeButton(getString(R.string.no), null).show();}
在软件使用过程中经常会遇到点击某个按钮后弹出让我们选择 是 或者 否 的窗口,这个再android上成为dialog 今天写下二选一dialog的实现实例
setmessage是dialog的标题,setpostivebutton就是二选一的其中一个按钮,这里定义为“是”,相对应的另外一个就是否了,后面重写的onclick为选择相应的按钮后处理事件的响应, 很简单,但是要常常积累啊,初学android么,就是一步一步的积累的。
另外今天在接触 写入操作 ObjectOutputStream中的writeobject 时 必须写入的对象是序列化后的,不然会报异常,即在定义对象时 implements Serializable 借口并定义
private static final long serialVersionUID = -870520749171665437L;或者private static final long serialVersionUID = 1;
- Android 弹出二选一窗口的实现 及Serializable
- android弹出窗口的实现
- android弹出窗口实现
- android弹出窗口的实现(PopupWindow)
- android弹出窗口的实现(PopupWindow)
- android弹出窗口的实现(PopupWindow)
- android弹出窗口的实现(PopupWindow)
- android弹出窗口的实现(PopupWindow)
- android弹出窗口的实现(PopupWindow)!!!!
- Android弹出窗口的实现(PopupWindow)
- android弹出窗口的实现(PopupWindow)
- android弹出窗口的实现(PopupWindow)
- android弹出窗口的实现(PopupWindow)
- android弹出窗口的实现(PopupWindow)
- Android弹出窗口的实现(PopupWindow)
- 弹出窗口的实现
- 弹出窗口功能的实现
- jQuery弹出窗口的实现
- Android 特殊字符转义
- EXCEL 学习
- linux bond interface configuration
- Centos安装webbench时出现/bin/sh: ctags: command not found解决方法
- 关于webbench网站压力测试工具
- Android 弹出二选一窗口的实现 及Serializable
- PHP出现Notice: unserialize() [function.unserialize]: Error at offset问题的解决方案
- 关于php curl上传文件出现(26)failed creating formpost data的解决方案
- Android应用中通过AIDL机制实现进程间的通讯实例
- 关于正则匹配不到大数据的解决办法
- POJ 1007 DNA Sorting (简单)
- Non-terminating decimal expansion; no exact representable decimal result.
- 黑马程序员Java学习-银行业务调度系统总结
- Android-opencv之CVCamera