undifinierte constructor

  • 1 Antworten
  • Neuester Beitrag
Diskutiere undifinierte constructor im Android App Entwicklung im Bereich Betriebssysteme & Apps.
G

guguli

Neues Mitglied
hi leute,
ich hab eine klasse, und hab auch dem entsprechend eine Konstruktor, dadrin hab ich diese zeile
Code:
lv.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, listview_array));
ich krieg aber die fehler meldung :
The constructor ArrayAdapter<String>(LoadMapDialog, int, String[]) is undefined...


ich poste am besten die ganze klasse:
Code:
public class LoadMapDialog extends Dialog implements View.OnClickListener {

	private MapEditorView mapEditorView;
	private Context context;
	private ListView lv;
	private EditText et;
	private Button delete;
	private Button back;
	
	private boolean firstTime;
	
	private String listview_array[] = { "ONE", "TWO", "THREE", "FOUR", "FIVE",
			"SIX", "SEVEN", "EIGHT", "NINE", "TEN" };
	private ArrayList<String> array_sort= new ArrayList<String>();
	int textlength=0;
	
	public LoadMapDialog(Context context, MapEditorView mapEditorView) {
		super(context);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		
		this.context = context;
		this.mapEditorView = mapEditorView;
		
		setContentView(R.layout.load_map_dialog);
		
		lv = (ListView) findViewById(R.id.ListView01);
		et = (EditText) findViewById(R.id.EditText01);
		
		delete = (Button) findViewById(R.id.button_delete);
		delete.setOnClickListener(this);
		
		back = (Button) findViewById(R.id.button_back);
		back.setOnClickListener(this);
		
		firstTime = true;
		
		
		//search the map like google seggest.... But have to be adapted
		lv.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, listview_array));

		et.addTextChangedListener(new TextWatcher()
		{
			public void afterTextChanged(Editable s)
			{
			                                                               
			}
			public void beforeTextChanged(CharSequence s,int start, int count, int after)
			{
		
			}
			public void onTextChanged(CharSequence s,int start, int before, int count)
			{
				textlength = et.getText().length();
				array_sort.clear();
				for (int i = 0; i < listview_array.length; i++){
					if (textlength <= listview_array[i].length()){
						if(et.getText().toString().equalsIgnoreCase((String)listview_array[i].subSequence(0,textlength)))
						{
							array_sort.add(listview_array[i]);
						}
			        }
			    }
			/*lv.setAdapter(new ArrayAdapter<String>
			(LoadMapDialog.this,android.R.layout.simple_list_item_1, array_sort));*/
			}
		});

	}
wie kann ich das lösen ????

thx
 
S

swordi

Lexikon
schau mal was der arrayadapter als 1. parameter benötigt.

dann gib ihm das