维护Study
##老师发了一个study来让我们纠错维护,整个软件是日程管理系统,分为欢迎界面,登录 注册界面,提醒界面添加日程界面,还有个人中心等。一些主要代码老师让我们把缺失部分去维护。首先我们读一下主要代码##
*WelcomActivity是一个欢迎界面,原始老师给的代码为以下代码*
···········
import com.avos.avoscloud.AVUser; import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler; public class WelcomeActivity extends Activity { Handler handler = new Handler(); Runnable runnable = new Runnable() { public void run() {
Intent intent = new Intent(WelcomeActivity.this, LoginActivity.class);
startActivity(intent);
finish(); } }; Runnable runnable1 = new Runnable() { public void run() {
Intent intent = new Intent(WelcomeActivity.this, MainActivity.class);
startActivity(intent);
finish(); } }; @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_welcome);
AVUser currentUser = AVUser.getCurrentUser(); if (currentUser != null) {
// 跳转到首页
handler.postDelayed(runnable1, 2000);
} else {
//缓存用户对象为空时,可打开用户注册界面…
handler.postDelayed(runnable, 2000);
} }
}
···········
##代码看起来没有什么问题,可是运行出现了一个小小的问题就是进入到下个界面是闪跳没有停顿,所以我就发现了在跳转首页时候应该加上一个代码
handler.postDelayed(runnable1, 2000);这样界面运行起来就美观合理些##

##其次注册界面,在运行时候出现输入账号密码都出现不能为空现象,原始代码如下:##
·············
import com.avos.avoscloud.AVException;
import com.avos.avoscloud.AVUser;
import com.avos.avoscloud.SignUpCallback; import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast; public class RegistActivity extends Activity {
EditText RegistName;
EditText RegistPwd;
EditText RegistPwd2;
Button Regist;
String RName;
String RPwd;
String RPwd2;
String regist; @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_regist);
RegistName = (EditText) findViewById(R.id.RegistName);
RegistPwd = (EditText) findViewById(R.id.RegistPwd);
RegistPwd2 = (EditText) findViewById(R.id.RegistPwd2);
Regist = (Button) findViewById(R.id.Regist); // 修改状态栏颜色,4.4+生效
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
setTranslucentStatus();
}
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setStatusBarTintResource(R.drawable.iphone);//通知栏所需颜色 Regist.setOnClickListener(new OnClickListener() { @Override
public void onClick(View v) {
// TODO Auto-generated method stub RName = RegistName.getText().toString();
RPwd = RegistPwd.getText().toString();
RPwd2 = RegistPwd2.getText().toString(); if (!"".equals(RName) && !"".equals(RPwd) && !"".equals(RPwd2)) { if (!RPwd.equals(RPwd2)) { Toast.makeText(RegistActivity.this, "两次输入的密码不一致", Toast.LENGTH_LONG).show(); } else { AVUser user = new AVUser();// 新建 AVUser 对象实例
user.setUsername(RName);// 设置用户名
user.setPassword(RPwd);// 设置密码
user.signUpInBackground(new SignUpCallback() {
@Override
public void done(AVException e) {
if (e == null) {
// 注册成功
Toast.makeText(RegistActivity.this, "注册成功", Toast.LENGTH_LONG).show();
Handler handler = new Handler();
Runnable runnable = new Runnable() { @Override
public void run() {
// TODO Auto-generated method stub
Intent intent = new Intent(RegistActivity.this, LoginActivity.class);
startActivity(intent);
finish(); }
};
handler.postDelayed(runnable, 2000);
} else {
// 失败的原因可能有多种,常见的是用户名已经存在。
Toast.makeText(RegistActivity.this, "用户名已存在", Toast.LENGTH_LONG).show();
}
}
});
}
} }
}); private void setTranslucentStatus() { Window window = this.getWindow();
// Translucent status bar
window.setFlags(
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
}
##在运行输入时候总是提示账户密码不能为空,那么,看上面两次密码输入不一致的语句中只有一个IF语句,else语句被遗漏没有其他情况来让程序判定执行,我再在其相对应的语句加上
else
{Toast.makeText(RegistActivity.this, "两次输入的密码一致", Toast.LENGTH_LONG).show();}代码##

##其三在登录出现了同样的错误,所以我又在相对应的地方加上了代码
else
{
Toast.makeText(LoginActivity .this, "两次输入的密码不一致", Toast.LENGTH_LONG).show();
}##

##其次我还发现了一些细节问题,在运行时候相对应的XML文件界面不去显示,例如list_item.xml,list_item1.xml界面,运行时候看不出来相对应的效果。##
维护Study的更多相关文章
- 【线段树维护复杂状态】Ryuji doesn't want to study
https://nanti.jisuanke.com/t/31460 tree[rt].ans = tree[rt << 1].ans + tree[rt << 1 | 1]. ...
- Machine Learning Algorithms Study Notes(2)--Supervised Learning
Machine Learning Algorithms Study Notes 高雪松 @雪松Cedro Microsoft MVP 本系列文章是Andrew Ng 在斯坦福的机器学习课程 CS 22 ...
- Codeforces 834D The Bakery【dp+线段树维护+lazy】
D. The Bakery time limit per test:2.5 seconds memory limit per test:256 megabytes input:standard inp ...
- 计蒜客 31460 - Ryuji doesn't want to study - [线段树][2018ICPC徐州网络预赛H题]
题目链接:https://nanti.jisuanke.com/t/31460 Ryuji is not a good student, and he doesn't want to study. B ...
- 徐州网络赛H-Ryuji doesn't want to study【线段树】
Ryuji is not a good student, and he doesn't want to study. But there are n books he should learn, ea ...
- Gitlab 社区版安装部署和维护指南
因为我的个人网站 restran.net 已经启用,博客园的内容已经不再更新.这篇文章是在 Gitlab 7.4 的环境下配置的,相关内容可能已经过时. 后续做了一次迁移,将 Gitlab 升级到了 ...
- Ryuji doesn't want to study 2018徐州icpc网络赛 树状数组
Ryuji is not a good student, and he doesn't want to study. But there are n books he should learn, ea ...
- ACM-ICPC 2018 徐州赛区网络预赛 H. Ryuji doesn't want to study (线段树)
Ryuji is not a good student, and he doesn't want to study. But there are n books he should learn, ea ...
- 【ASE模型组】Hint::neural 模型与case study
模型 基于搜索的提示系统 我们的系统用Pycee针对语法错误给出提示.然而,对于语法正确.结果错误的代码,我们需要另外的解决方式.因此,我们维护一些 (错误代码, 相应提示) 的数据,该数据可以由我们 ...
随机推荐
- 【.Net Framework 体积大?】不安装.net framework 也能运行!?原理补充-3
继续补充点吧.接上一篇,我们实现了.net framework的精简的步骤. 有网友评论了,那个核心的 mscoree.dll 从.net framework 2.0开始,微软开始了新的CLR承载模型 ...
- Struts2系列笔记(2)---Struts.XML
Struts2.xml 本篇博客主要讲Struts2.xml中package下的标签和标签属性,主要分以下四个部分说明: (1)action的配置基本属性 (2)同一个Action类中不同方法满足不同 ...
- Python之字符串详解1
1. 查看类型 name = 'allen' print(type(name)) #查看类型 <class 'str'> #类型为str age = 19 print(type(name) ...
- .NET 十五岁,谈谈我眼中的.NET
2002年2月13日,第一个版本随着visual studio.net的发布,今天已经走过15年, .net团队写了一篇文章,里面有一个视频,Anders Hejlsberg已是白发苍苍的老人,我也从 ...
- matlab 子函数的使用
本文参考了该篇博客:http://www.cnblogs.com/MarshallL/p/4048846.html 对其进行学习,为我所用吧. 一. 在matlab的函数定义中,如果函数如果函数较长或 ...
- Sublime Text 3 修改配色主题【侧边框之...】
Sublime Text3 是挺喜欢的一款编辑器,一周五天朝九晚六面对,而默认的侧边栏颜色总显得不尽人意.右侧的代码高亮[color_scheme:Monokai]挺喜欢的,心里就想着如何把侧边栏也给 ...
- HTML5拖放事件-上传图片预览功能
主要用到的知识点有dataTransfer对象和FileReader(读取文件信息) 1.创建简单的HTML标签: <body> <div id="box"> ...
- Hadoop基本开发环境搭建(原创,已实践)
软件包: hadoop-2.7.2.tar.gz hadoop-eclipse-plugin-2.7.2.jar hadoop-common-2.7.1-bin.zip eclipse jdk1.8 ...
- .net 爬虫技术
关于爬虫 从搜索引擎开始,爬虫应该就出现了,爬的对象当然也就是网页URL,在很长一段时间内,爬虫所做的事情就是分析URL.下载WebServer返回的HTML.分析HTML内容.构建HTTP请求的模拟 ...
- MRC、ARC内存管理机制
MRC下,oc内存管理遵循"谁创建.谁释放.谁引用.谁管理"的机制,当创建或引用一个对象时,需要向她发送alloc,copy,retain消息,当释放该对象时需要发送release ...