BadTokenException when click on spinner in an ActivityGroup
===

I searched now for two days for a solution, but i didnt find something that work.

I have a TabHost with 4 tabs and change can change the view from the first tab to another where i have a spinner. This spinner get initialized correct, but I'm not able to click on it, cause if I do I get an BadTokenException
<pre>07-28 13:52:59.446: E/AndroidRuntime(692): android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@405496d8 is not valid; is your activity running?
</pre>

Now to Code:
<pre>viewToLoad = LayoutInflater.from(this).inflate(R.layout.projekt_daten, null);
		this.setContentView(viewToLoad);</pre>
To understand some Variables my function call
<pre>fuelleSpinner("SELECT _id, name FROM kunden", R.id.s_kundenauswahl);</pre>

So i fill the spinner:
<pre>private void fuelleSpinner(String selection, int spinnerID){

	Cursor spinnerCursor = mDatenbank.rawQuery(selection, null);
	spinner = (Spinner) findViewById(spinnerID);
	String[] data = new String[spinnerCursor.getCount()];
	
	for(int i = 0; i < spinnerCursor.getCount();i++){
		spinnerCursor.moveToPosition(i);
		data[i] = spinnerCursor.getString(1);
	}	
	
	ArrayAdapter<CharSequence> adapter = 
		new ArrayAdapter<CharSequence>(getParent(), android.R.layout.simple_spinner_item, data);

	adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
	spinner.setAdapter(adapter);
}</pre>

I also tried this:
<pre>ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
	            getParent(), R.array.array_name, android.R.layout.simple_spinner_item);</pre>
Both ways initialize the spinner correctly, but if i click on the spinner the app crashes.