Results 1 to 3 of 3
Thread: drop down list
- 11-18-2011, 10:53 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 12
- Rep Power
- 0
drop down list
hi all
iam new to Java and i found how to write spinner code Spinner | Android Developers
since i dont have Java knowledge i have tow questions :
first question :
how do i change the code in spinner that when i choose lets say "Venus" it will show me the number 555
i have changed the code like that but it dose not work :
Java Code:
public class MyOnItemSelectedListener implements OnItemSelectedListener {
public void onItemSelected(AdapterView<?> parent,
View view, int pos, long id){
if (parent.getItemAtPosition(pos).toString().equals(" Venus"))
{
Toast.makeText(MyOnItemSelectedListener.this, "555", Toast.LENGTH_LONG).show();
}
public void onNothingSelected(AdapterView parent) {
// Do nothing.
}
}
second question :
can I have link for learning writing Java code for android plez
thanks for the helpers :)
- 11-19-2011, 08:13 AM #2
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 785
- Rep Power
- 12
Re: drop down list
toString().equals(" Venus") is not equals to lets say "Venus"
- 11-20-2011, 10:25 PM #3
Member
- Join Date
- Oct 2011
- Posts
- 12
- Rep Power
- 0
Similar Threads
-
Please help : drop down list value not change after submit
By kalyana in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 07-01-2011, 02:27 PM -
what code for searching in drop down list?
By Harmesh Goyal in forum Advanced JavaReplies: 1Last Post: 03-03-2011, 05:43 AM -
Using getElementById() to get values from drop down list
By oric1 in forum NetBeansReplies: 0Last Post: 01-05-2011, 08:28 AM -
Populating a drop down list from a database
By matpj in forum New To JavaReplies: 0Last Post: 01-19-2009, 01:14 PM -
JComboBox and drop-down list.....HELP!!!!!
By Anna in forum AWT / SwingReplies: 1Last Post: 06-18-2008, 06:16 AM
Bookmarks