問題があります。私の活動ではボタンがあり、クリックするとメソッドが呼び出されます。このメソッドは、私にlistviewの警告ダイアログを表示し、アイテムのクリックを変数に保存したいのですが、メソッドを閉じたいが閉じない!なぜ??私はメソッドのコードを投稿します。私のlogcatは私に何のエラーも与えません。誰も私を助けることができますか?してくださいアラートダイアログが閉じない
private void getValuta() {
AlertDialog.Builder miaAlert = new AlertDialog.Builder(this);
final ListView lV = new ListView(this);
Cursor c = null;
miaAlert.setTitle("Choose Valuta");
c = vdb.fetchValuteListView("0");
startManagingCursor(c);
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_1,
c,
new String[] {
ValuteDb.ValuteMetaData.VALUTE_NAME_KEY},
new int[] { android.R.id.text1});
stopManagingCursor(c);
lV.setAdapter(adapter);
miaAlert.setView(lV);
miaAlert.setCancelable(false);
lV.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v,
int position, long id) {
String riga = String.valueOf(id);
String confr = vdb.getRecord(riga,2);
System.out.println("position= " + position + "/id= " + id+"/nome= "+confr);
new_valuta = vdb.getRecord(riga,2);
listdb.update("9", "Valuta", new_valuta, "2");
c_list.requery();
return;
}
});
AlertDialog alert = miaAlert.create();
alert.show();}
が重複する可能性を却下する[方法閉じません](http://stackoverflow.com/questions/10011500/method-doesnt-close) – Luksprog
しないでください重複した質問を投稿する。ああ、私はダイアログではなく、メソッドを閉じたいと思っています –