Code example for ArrayAdapter

Methods: getPosition

0
	public void setCurrentCategorie(String newCat){
		//Log.d(TAG,"categorie from outside>"+newCat+"<"); 
		if (newCat!=null && ! newCat.equals(""))
		{ 
		 
			int p=((ArrayAdapter)mSpinner.getAdapter()).getPosition(newCat);
			mSpinner.setSelection(p,false);//no animation
			//Log.d(TAG,"spinner state is now >"+mSpinner.getSelectedItemId()+"<< adapter thinks >>"+p+"<<"); 
		} 
	///	fireEvent(newCat); 
	} 
 
 
	public void initList(){ 
 
		if (mCursor!=null)
		{ 
			mCursor.moveToFirst();
			final int c=mCursor.getCount();
			final int cIndex=mCursor.getColumnIndexOrThrow(
				News.Categories.NAME