首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

checkBox中只用数字有关问题以及AsyncActivity中使用ProgressDialog

2012-08-24 
checkBox中只用数字问题以及AsyncActivity中使用ProgressDialogcb(CheckBox)findViewById(R.id.cek)??cb

checkBox中只用数字问题以及AsyncActivity中使用ProgressDialog

cb=(CheckBox)findViewById(R.id.cek);?
?
cb.setOnClickListener(new OnClickListener() { ?// checkbox listener?
? ? public void onClick(View v) {?
? ? ? ? // Perform action on clicks, depending on whether it's now checked?
? ? ? ? if (((CheckBox) v).isChecked()) {?
? ? ? ? ? ? tv1.setVisibility(0); ?//visible==0?
? ? ? ? ? ? et3.setVisibility(0);?
? ? ? ? } else if (((CheckBox) v).isChecked() == false) {?
? ? ? ? ? ? tv1.setVisibility(2); //gone=2 ??
? ? ? ? ? ? ? ? et3.setVisibility(2);?
? ? ? ? }?
? ? }?
});?

?

?

这里不能使用数字 直接使用gone等不然没有效果,

2.

class AddTask extends AsyncTask<Void, Item, Void> {?
?
? ? protected void onPreExecute() {?
???????// pDialog = ProgressDialog.show(MyActivity.this,"Please wait...", "Retrieving data ...", true);?

?dialog = new ProgressDialog(viewContacts.this);?
? ? ? ? dialog.setMessage(getString(R.string.please_wait_while_loading));?
? ? ? ? dialog.setIndeterminate(true);?
? ? ? ? dialog.setCancelable(false);?
? ? ? ? dialog.show();?

??? }?


?
??? protected Void doInBackground(Void... unused) {?
? ? ? ? items = parser.getItems();?
?
? ? ? ? for (Item it : items) {?
? ? ? ? ? ? publishProgress(it);?
? ? ? ? }?
? ? ? ? return(null);?
? ? }?
?
? ? protected void onProgressUpdate(Item... item) {?
? ? ? ? adapter.add(item[0]);?
? ? }?
?
? ? protected void onPostExecute(Void unused) {?
? ? ? ? pDialog.dismiss();?
? ? }?
? }?

热点排行