某種佈局中奇怪的問題的..我有一個線性佈局像下面具有文本視圖和圖像視圖...我已經寫了線性佈局的單擊事件ID被驗證)我已經得到了一些東西做的...我發現 - 這兩個孩子的意見也正在採取那些點擊事件,並同時在兩個執行結束了......我不能禁用這些焦點或可點擊的事件。 ...(點擊該事件 - 我打電話給一個異步)是否有任何禁用這些意見的焦點...我已經嘗試了大部分像android:focusable和android:clickable ....但它沒有不幫助.. :(佈局及其子
<LinearLayout
android:id="@+id/verify"
android:layout_width="150dp"
android:layout_height="100dp"
android:layout_marginLeft="10dp"
android:background="@drawable/clearbluesky"
android:orientation="vertical"
>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="false"
android:focusable="false"
android:text="Verify"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@android:color/black" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="70dp"
android:layout_height="30dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:clickable="false"
android:focusable="false"
android:src="@drawable/fps" />
</LinearLayout>
continue.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
new AsyncTask<String, String, String>()
{
boolean testresult = false;
boolean clearBuf = false;
ProgressDialog progressDialog = null;
@Override
protected void onPostExecute(String result){ super.onPostExecute(result);
progressDialog.dismiss();
}
@Override
protected void onPreExecute() {
super.onPreExecute();
progressDialog = new ProgressDialog(getApplicationContext());
progressDialog.setMessage("Continue");
progressDialog.setIndeterminate(false);
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.show();
}
@Override
protected String doInBackground(String... params) {
// Calling some function
return null;
}
}.execute("");
});
你可以張貼onClickListener代碼.. – user936414 2012-03-28 04:23:00
我有一個片段的onClick轉貼吧..請... – 2012-03-28 05:14:17
的onClick()方法被調用一次。由於textView或imageView沒有問題。 – user936414 2012-03-28 05:28:39