I asked a question here and got the answer
OK, all I needed was to add package name in xml file, so this spinner works now, but another problem has appeared. To select the element, that was selected during the initialise, I have to click on it twice. I guess, it is because I use a counter to check if the item selected by user:
variables.spinner1.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view,
int position, long id) {
CharSequence t2 = (CharSequence) parent.getItemAtPosition(position);
variables.wall=t2.toString();
if(i>0){
new DownloadRow().execute();
}
if(i==0) i++;
}
@Override
public void onNothingSelected(AdapterView<?> arg0)
// TODO Auto-generated method stub
}
});
What have I do to make it so that user will need to click on a selected item only once?
just a hint (i.e. you don't want any processing at all), no, this is an amiss variant. Situation is, when user clicks element at position 0 (or on any other position) new DownloadRow().execute() have to start. But now (I don't know why) if user clicks element at zero position, nothing happens. If he clicks it again DownloadRow().execute() starts, as it had to be done after the first user click. It looks like if during initialise of this spinner increament of var i doesn't happen (or some other problem). But if I do increament again if position==0. then DownloadRow().execute() starts automatically, user doesn't select an iem himself.