用户注册



邮箱:

密码:

用户登录


邮箱:

密码:
记住登录一个月忘记密码?

发表随想


还能输入:200字
云代码 - android代码库

表格

2013-04-14 作者: 云代码会员举报

[android]代码库

public class DeploymentJobsActivity extends Activity implements OnClickListener {
	private Button search;
	private ListView listView;
	private DeploymentJobsAdapter adapter;
	private List<Deploy> list = new ArrayList<Deploy>();
	private ImageButton backButton;
	private EditText startDatEditText, endDatEditText;
	private Button startDateButton, endDateButton;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.deployment_jobs_activity);
		initView();
		initListener();
		Deploy deploy;
		for (int i = 0; i < 20; i++) {
			deploy = new Deploy();
			deploy.setTitle("巡查" + i);
			deploy.setMainpoint("水的质量" + i);
			deploy.setLeader("元芳" + i);
			deploy.setPort("注意安全" + i);
			list.add(deploy);
		}
		adapter = new DeploymentJobsAdapter(this, list);
		listView.setAdapter(adapter);
	}

	private void initView() {
		search = (Button) findViewById(R.id.deployment_jobs_search);
		listView = (ListView) findViewById(R.id.deployment_jobs_listView);
		backButton = (ImageButton) findViewById(R.id.deployment_jobs_back);
		startDatEditText = (EditText) findViewById(R.id.deployment_jobs_startend_editText);
		startDateButton = (Button) findViewById(R.id.deployment_jobs_start_Date_button);
		endDatEditText = (EditText) findViewById(R.id.deploymetn_jobs_end_editText);
		endDateButton = (Button) findViewById(R.id.deployment_jobs_end_Date_button);
		
	}

	private void initListener() {
		search.setOnClickListener(this);
		backButton.setOnClickListener(this);
		startDateButton.setOnClickListener(this);
		endDateButton.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.deployment_jobs_search:

			break;
		case R.id.deployment_jobs_back:
			startActivity(new Intent(this, MainActivity.class));
			break;
		case R.id.deployment_jobs_start_Date_button:
			DateUtils utils = new DateUtils(this, startDatEditText);
			utils.ShowDatePick();
			break;
		case R.id.deployment_jobs_end_Date_button:
			DateUtils utils2 = new DateUtils(this, endDatEditText);
			utils2.ShowDatePick();
			break;
		default:
			break;
		}
	}
}

[代码运行效果截图]


表格


网友评论    (发表评论)

共1 条评论 1/1页

发表评论:

评论须知:

  • 1、评论每次加2分,每天上限为30;
  • 2、请文明用语,共同创建干净的技术交流环境;
  • 3、若被发现提交非法信息,评论将会被删除,并且给予扣分处理,严重者给予封号处理;
  • 4、请勿发布广告信息或其他无关评论,否则将会删除评论并扣分,严重者给予封号处理。


扫码下载

加载中,请稍后...

输入口令后可复制整站源码

加载中,请稍后...