[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;
}
}
}
[代码运行效果截图]
初级程序员
by: 程序猿M 发表于:2013-04-30 12:26:14 顶(1) | 踩(0) 回复
却代码啊
回复评论