- 1、本文档共10页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Android报告
Android开发报告学号:140206400025姓名:赵轩专业班级:14级计算机应用技术1班实验目的:充分掌握android开发中的各项技术,并会使用android的api实验环境: android studio2.1.2API 23实验功能:用户登陆,强制下线基本原理:使用广播功能对用户进行强制下线,使用SharedPreferences对面账号密码进行保存,实现记住密码的功能。运行截图:登陆时选择记住密码并登陆点击强制下线然后点击ok发现主页面账号密码已经自动填写上去了代码如下:登陆布局login.xml?xml version=1.0 encoding=utf-8?TableLayout xmlns:android=/apk/res/android android:layout_width=match_parent android:layout_height=match_parent android:stretchColumns=1 TableRow TextView android:layout_height=wrap_content android:text=账号: / EditText android:id=@+id/account android:layout_height=wrap_content / /TableRow TableRow TextView android:layout_height=wrap_content android:text=密码:/ EditText android:id=@+id/password android:layout_height=wrap_content android:inputType=textPassword / /TableRow TableRow CheckBox android:id=@+id/remember_pass android:layout_height=wrap_content / TextView android:text=记住密码 android:layout_height=wrap_content/ /TableRow TableRow Button android:id=@+id/login android:layout_height=wrap_content android:layout_span=2 android:text=登陆/ /TableRow/TableLayout强制下线页面布局activity_main.xml?xml version=1.0 encoding=utf-8?LinearLayout xmlns:android=/apk/res/androidandroid:orientation=vertical android:layout_width=match_parentandroid:layout_height=match_parentButton android:id=@+id/force_offline android:layout_width=match_parent android:layout_height=wrap_content android:text=发送强制离线广播//LinearLayout创建一个ActivityCollecotr类用于管理所有的活动ActivityCollector.kavapackage com.example.hhhhhhh.broadcastpractice;import android.app.Activity;import java.util.ArrayList;import java.util.List;public class ActivityCollector { public static ListActivity activities=new ArrayListActivity(); public static void addActivity(Activity activity){ activities.add(activity); } public static void removeActivity(Activity activity){ activities.remove(activity); } public static void finishAll(){ for (Activity activity:activities){ if (!activity.isFinishing()){ activity.finish(); } } }}然后创建BaseActivity类为所有活动类的父类BaseActivity.javapackag
您可能关注的文档
- Alcoholism 酗酒.pptx
- AMCT基础检验通则.doc
- ALS3_介绍.ppt
- AMF造型机操作指导.doc
- AM和DSB振幅调制器.ppt
- AIX高级系统管理培训教材AU16-LONTON.ppt
- Android手势密码的实现.doc
- Android移动终端开发大作业.doc
- android源码分析之Runtime的初始化.doc
- Android开发入门.ppt
- 浙江衢州市卫生健康委员会衢州市直公立医院高层次紧缺人才招聘11人笔试模拟试题参考答案详解.docx
- 浙江温州泰顺县退役军人事务局招聘编外工作人员笔试备考题库及参考答案详解一套.docx
- 江苏靖江市数据局公开招聘编外工作人员笔试模拟试题及参考答案详解.docx
- 广东茂名市公安局电白分局招聘警务辅助人员40人笔试模拟试题带答案详解.docx
- 江苏盐城市大丰区住房和城乡建设局招聘劳务派遣工作人员4人笔试模拟试题带答案详解.docx
- 浙江舟山岱山县东沙镇人民政府招聘笔试模拟试题及参考答案详解1套.docx
- 最高人民检察院直属事业单位2025年度公开招聘工作人员笔试模拟试题含答案详解.docx
- 浙江金华市委宣传部、中共金华市委网信办所属事业单位选调工作人员笔试备考题库及答案详解1套.docx
- 广东深圳市党建组织员招聘40人笔试模拟试题及答案详解1套.docx
- 江苏南京水利科学研究院招聘非在编工作人员4人笔试模拟试题及参考答案详解.docx
最近下载
- 2025年4月20日四川省事业单位考试《公共基础知识》试题及答案解析参考.pdf
- 中层竞聘面试题目答案.doc VIP
- 电力系统优化与调度软件:PLEXOS二次开发_(4).电力系统优化理论.docx VIP
- 传染病、消毒知识测试题及答案.docx VIP
- 2025年解放军联勤保障部队第960医院医护人员招聘备考试题及答案解析.docx VIP
- 2021年版国家免疫规划疫苗儿童免疫程序相关知识考核试题含答案.docx VIP
- 电力系统优化与调度软件:Xpress二次开发_(3).电力系统优化问题的数学建模.docx VIP
- 中建钢筋精算管理操作手册.pdf VIP
- 电商仓库主管月工作总结.pptx
- 预防接种工作规范(2023版)试题.docx VIP
文档评论(0)