Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

I copied the code provided by Dimitar Vukman and Blundell from this linkthis link and then updated this code as Alex Miragall instructed some posts down (because now I'm creating an application for Android 4.0). I removed Dimitar's onClick method and pasted Alex's code at the end of the class.

The firstThe first

The secondThe second

I copied the code provided by Dimitar Vukman and Blundell from this link and then updated this code as Alex Miragall instructed some posts down (because now I'm creating an application for Android 4.0). I removed Dimitar's onClick method and pasted Alex's code at the end of the class.

The first

The second

I copied the code provided by Dimitar Vukman and Blundell from this link and then updated this code as Alex Miragall instructed some posts down (because now I'm creating an application for Android 4.0). I removed Dimitar's onClick method and pasted Alex's code at the end of the class.

The first

The second

deleted 1049 characters in body
Source Link

OK, all I needed was to add package name in xml file, so this spinner works now, but another problem have 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?

OK, all I needed was to add package name in xml file, so this spinner works now, but another problem have 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?

added 1051 characters in body
Source Link

OK, all I needed was to add package name in xml file, so this spinner works now, but another problem have 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?

OK, all I needed was to add package name in xml file, so this spinner works now, but another problem have 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?

Moved information about information the user already looked up to the end so that it's easier to get to the meat of the question.
Source Link
Loading
added 7038 characters in body
Source Link
Loading
Source Link
Loading