XyApp/src/com/dy/AddCzActivity.java
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.dy;
import java.net.URLEncoder;
import com.dy.HttpUtil;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class AddCzActivity extends Activity {
// 声明登录、取消按钮
private Button Btn1;
// 声明用户名、密码输入框
private EditText userName,pwd,moneys,tel;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 设置标题
// 设置当前Activity界面布局
setContentView(R.layout.addcz);
// 通过findViewById方法实例化组件
Btn1 = (Button)findViewById(R.id.registerButton1);
// 通过findViewById方法实例化组件
// 通过findViewById方法实例化组件
userName = (EditText)findViewById(R.id.userName);
// 通过findViewById方法实例化组件
pwd = (EditText)findViewById(R.id.pwd);
moneys = (EditText)findViewById(R.id.moneys);
tel = (EditText)findViewById(R.id.tel);
Btn1.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
try {
Declare declare = (Declare) getApplicationContext();
int myid = declare.getId();
if(userName.getText()!=null&&pwd.getText()!=null){
String url = HttpUtil.BASE_URL
+ "QAddCzServlet?no="
+ URLEncoder.encode(
URLEncoder.encode(userName.getText().toString(), "UTF-8"), "UTF-8")+"&password="
+ URLEncoder.encode(
URLEncoder.encode(pwd.getText().toString(), "UTF-8"), "UTF-8")
+"&myid="+myid+"&moneys="+moneys+"&tel="+tel;
// 查询返回结果
String result = HttpUtil.queryStringForPost(url);
if(result.equals("1")){
Toast.makeText(getApplicationContext(), "添加成功", 1).show();
Intent intent = new Intent();
intent.setClass(AddCzActivity.this,
SearchCzMyActivity.class);
startActivity(intent);
AddCzActivity.this.finish();
}else if(result.equals("2")){
}else{
后面还有 38 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。