正在使用我自定義的customDialog來顯示list.my要求是在我的application.i中有Edittext的地方我需要在editext中使用Textwatcher顯示這個dialog.am,而用戶輸入一個數字就好像用戶輸入1那樣將它傳遞給那個對話類並且完成了一些功能來創建一個像10,100,1000,10000這樣的列表。從對話框內容SetText到EditTextBox?
現在,一旦用戶從此列表中選擇任何數字,我想將其設置爲Editext.How可以這樣做嗎?我試了一整天?
public static void amount_dialog(final Activity activity,String str)
{
amount=str;
sequence_number();//from this method am generating list and setting it into my Arraylist
dialog=new Dialog(activity,R.style.CustomDialogTheme);
dialog.setContentView(R.layout.customdialog);
ListView listView=(ListView) dialog.findViewById(R.id.listView12);
adapter=new ArrayAdapter<String>(activity,R.layout.list2,R.id.list_text1, strings);
listView.setAdapter(adapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
selected_amount=adapter.getItem(arg2);
dialog.dismiss();
}
});
dialog.getWindow().getAttributes().windowAnimations = R.style.DialogAnimation;
dialog.show();
dialog.setCanceledOnTouchOutside(true);
}
真棒其wrking.thanks – Thamilvanan
是它可以helful到others.accepted – Thamilvanan
耶ü[R儀式.Thanks .. –