Go Back   Android Forums > Android Development > Application Development
Application Development Dev Lounge for the Coder Folks
Gamers - Check out our new sister sites!
Nintendo Wii U!    |    OUYA - $99 Android System!

test: Reply
 
LinkBack Thread Tools
Old July 4th, 2012, 05:16 AM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Jul 2012
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Laugh Spinner choice

Hi guys,

I want to create an app, but I have first little problem.

I have a Spinner and TextView and some strings in resources. And I want to make, when I choose some item from Spinner, for example, Czech Republic, I want to appear in TextView "Capital City: Prague".

Any idea how to do that? Thanks a lot

ConnorCZ is offline  
Reply With Quote
Sponsors
Old July 4th, 2012, 06:58 AM   #2 (permalink)
Junior Member
 
Join Date: Jun 2011
Posts: 31
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Pretty sure it goes by attaching something like following to spinners onChange event. The pos is selected item(from 0 onward).

public class MyOnItemSelectedListener implements OnItemSelectedListener {

public void onItemSelected(AdapterView<?> parent,
View view, int pos, long id) {
// here alter the textview
}

public void onNothingSelected(AdapterView parent) {
// Do nothing.
}
}
tneva82 is offline  
Reply With Quote
Reply
Tags
spinner, textview


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 02:21 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.