package com.mobileclient.activity;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import com.mobileclient.util.HttpUtil;
import com.mobileclient.util.ImageService;
import com.mobileclient.domain.Hourse;
import com.mobileclient.service.HourseService;
import com.mobileclient.domain.BuildingInfo;
import com.mobileclient.service.BuildingInfoService;
import com.mobileclient.domain.HourseType;
import com.mobileclient.service.HourseTypeService;
import com.mobileclient.domain.PriceRange;
import com.mobileclient.service.PriceRangeService;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.Spinner;
import android.widget.Toast;
public class HourseEditActivity extends Activity {
// 声明确定添加按钮
private Button btnUpdate;
// 声明房屋编号TextView
private TextView TV_hourseId;
// 声明房屋名称输入框
private EditText ET_hourseName;
// 声明所在楼盘下拉框
private Spinner spinner_buildingObj;
private ArrayAdapter<String> buildingObj_adapter;
private static String[] buildingObj_ShowText = null;
private List<BuildingInfo> buildingInfoList = null;
/*所在楼盘管理业务逻辑层*/
private BuildingInfoService buildingInfoService = new BuildingInfoService();
// 声明房屋图片图片框控件
private ImageView iv_housePhoto;
private Button btn_housePhoto;
protected int REQ_CODE_SELECT_IMAGE_housePhoto = 1;
private int REQ_CODE_CAMERA_housePhoto = 2;
// 声明房屋类型下拉框
private Spinner spinner_hourseTypeObj;
private ArrayAdapter<String> hourseTypeObj_adapter;
private static String[] hourseTypeObj_ShowText = null;
private List<HourseType> hourseTypeList = null;
/*房屋类型管理业务逻辑层*/
private HourseTypeService hourseTypeService = new HourseTypeService();
// 声明价格范围下拉框
private Spinner spinner_priceRangeObj;
private ArrayAdapter<String> priceRangeObj_adapter;
private static String[] priceRangeObj_ShowText = null;
private List<PriceRange> priceRangeList = null;
/*价格范围管理业务逻辑层*/
private PriceRangeService priceRangeService = new PriceRangeService();
// 声明面积输入框
private EditText ET_area;
// 声明租金(元/月)输入框
private EditText ET_price;
// 声明楼层/总楼层输入框
private EditText ET_louceng;
// 声明装修输入框
private EditText ET_zhuangxiu;
// 声明朝向输入框
private EditText ET_caoxiang;
// 声明建筑年代输入框
private EditText ET_madeYear;
// 声明联系人输入框
private EditText ET_connectPerson;
// 声明联系电话输入框
private EditText ET_connectPhone;
// 声明详细信息输入框
private EditText ET_detail;
// 声明地址输入框
private EditText ET_address;
protected String carmera_path;
/*要保存的房屋信息信息*/
Hourse hourse = new Hourse();
/*房屋信息管理业务逻辑层*/
private HourseService hourseService = new HourseService();
private int hourseId;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//去除title
requestWindowFeature(Window.FEATURE_NO_TITLE);
//去掉Activity上面的状态栏
getWindow().setFlags(WindowManager.LayoutParams. FLAG_FULLSCREEN , WindowManager.LayoutParams. FLAG_FULLSCREEN);
// 设置当前Activity界面布局
setContentView(R.layout.hourse_edit);
ImageView search = (ImageView) this.findViewById(R.id.search);
search.setVisibility(View.GONE);
TextView title = (TextView) this.findViewById(R.id.title);
title.setText("编辑房屋信息信息");
ImageView back = (ImageView) this.findViewById(R.id.back_btn);
back.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View arg0) {
finish();
}
});
TV_hourseId = (TextView) findViewById(R.id.TV_hourseId);
ET_hourseName = (EditText) findViewById(R.id.ET_hourseName);
spinner_buildingObj = (Spinner) findViewById(R.id.Spinner_buildingObj);
// 获取所有的所在楼盘
try {
buildingInfoList = buildingInfoService.QueryBuildingInfo(null);
} catch (Exception e1) {
e1.printStackTrace();
}
int buildingInfoCount = buildingInfoList.size();
buildingObj_ShowText = new String[buildingInfoCount];
for(int i=0;i<buildingInfoCount;i++) {
buildingObj_ShowText[i] = buildingInfoList.get(i).getBuildingName();
}
// 将可选内容与ArrayAdapter连接起来
buildingObj_adapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, buildingObj_ShowText);
// 设置图书类别下拉列表的风格
buildingObj_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// 将adapter 添加到spinner中
spinner_buildingObj.setAdapter(buildingObj_adapter);
// 添加事件Spinner事件监听
spinner_buildingObj.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1,int arg2, long arg3) {
hourse.setBuildingObj(buildingInfoList.get(arg2).getBuildingId());
}
@Override
public void onNothingSelected(AdapterView<?> arg0) {}
});
// 设置默认值
spinner_buildingObj.setVisibility(View.VISIBLE);
iv_housePhoto = (ImageView) findViewById(R.id.iv_housePhoto);
/*单击图片显示控件时进行图片的选择*/
iv_housePhoto.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setClass(HourseEditActivity.this,photoListActivity.class);
startActivityForResult(intent,REQ_CODE_SELECT_IMAGE_housePhoto);
}
});
btn_housePhoto = (Button) findViewById(R.id.btn_housePhoto);
btn_housePhoto.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
carmera_path = HttpUtil.FILE_PATH + "/carmera_housePhoto.bmp";
File out = new File(carmera_path);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(out));
startActivityForResult(intent, REQ_CODE_CAMERA_housePhoto);
}
});
spinner_hourseTypeObj = (Spinner) findViewById(R.id.Spinner_hourseTypeObj);
// 获取所有的房屋类型
try {
hourseTypeList = hourseTypeService.QueryHourseType(null);
} catch (Exception e1) {
e1.printStackTrace();
}
int hourseTypeCount = hourseTypeList.size();
hourseTypeObj_ShowText = new String[hourseTypeCount];
for(int i=0;i<hourseTypeCount;i++) {
hourseTypeObj_ShowText[i] = hourseTypeList.get(i).getTypeName();
}
// 将可选内容与ArrayAdapter连接起来
hourseTypeObj_adapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, hourseTypeObj_ShowText);
// 设置图书类别下拉列表的风格
hourseTypeObj_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// 将adapter 添加到spinner中
spinner_hourseTypeObj.setAdapter(hourseTypeObj_adapter);
// 添加事件Spinner事件监听
spinner_hourseTypeObj.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public vo
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
本人十余年JAVA架构设计经验,擅长JAVA高可用、分布式、高并发系统架构设计。有志于做JAVA系统性的技术提升的同学可与我联系,交个朋友哦~ 本人十余年JAVA架构设计经验,擅长JAVA高可用、分布式、高并发系统架构设计。有志于做JAVA系统性的技术提升的同学可与我联系,交个朋友哦~ 本人十余年JAVA架构设计经验,擅长JAVA高可用、分布式、高并发系统架构设计。有志于做JAVA系统性的技术提升的同学可与我联系,交个朋友哦~
资源推荐
资源详情
资源评论
收起资源包目录
《毕业设计&代码复用》--基于安卓Android房屋租赁系统app设计毕业源码案例设计.zip (524个子文件)
.classpath 3KB
.classpath 364B
org.eclipse.wst.jsdt.ui.superType.container 49B
index.css 2KB
style.css 2KB
desk.css 841B
Thumbs.db 54KB
Thumbs.db 26KB
logo.gif 81KB
login_03.gif 30KB
login_08.gif 25KB
login_03 - 副本.gif 19KB
login_05.gif 7KB
login_07.gif 5KB
main_30.gif 3KB
main_40.gif 3KB
main_03.gif 3KB
main_32.gif 2KB
main_04.gif 2KB
main_29.gif 2KB
main_22.gif 2KB
main_48.gif 2KB
main_47.gif 2KB
login_06.gif 2KB
error_b.gif 1KB
main_20.gif 1KB
main_18.gif 1KB
main_12.gif 1KB
main_11.gif 1KB
main_14.gif 1KB
main_16.gif 1KB
tab_17.gif 924B
tab_17.gif 924B
main_58.gif 804B
tab_20.gif 770B
tab_20.gif 770B
tab_07.gif 752B
tab_07.gif 752B
back.gif 749B
back.gif 749B
next.gif 745B
next.gif 745B
last.gif 741B
last.gif 741B
go.gif 736B
first.gif 736B
go.gif 736B
first.gif 736B
tab_18.gif 715B
tab_18.gif 715B
main_07.gif 701B
tab_03.gif 699B
tab_03.gif 699B
main_37.gif 661B
main_05.gif 640B
tb.gif 585B
tb.gif 585B
main_31.gif 552B
tab_19.gif 420B
tab_19.gif 420B
dl.gif 377B
tab_05.gif 375B
tab_05.gif 375B
11.gif 341B
11.gif 341B
33.gif 337B
33.gif 337B
main_21.gif 317B
main_34.gif 292B
bg.gif 273B
22.gif 215B
22.gif 215B
main_36.gif 203B
main_55_1.gif 201B
main_55.gif 201B
edt.gif 197B
edt.gif 197B
bg.gif 160B
del.gif 145B
del.gif 145B
left.gif 124B
tab_15.gif 112B
tab_15.gif 112B
tab_12.gif 111B
tab_12.gif 111B
main_59.gif 93B
main_62.gif 92B
main_52.gif 79B
main_51.gif 77B
main_45.gif 52B
main_41.gif 52B
main_39.gif 52B
main_61.gif 37B
.gitattributes 91B
tab.html 23KB
middel.html 2KB
down.html 879B
center.html 715B
right.html 0B
spring.jar 2.81MB
共 524 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
季风泯灭的季节
- 粉丝: 1861
- 资源: 3371
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功