edittext has to go enable from disable after select the item

Tutorials with advanced 'difficulty' and more Lines of Code.

edittext has to go enable from disable after select the item

Postby ezhil » Fri Feb 11, 2011 11:41 am

hi every one,

My code:
Code: Select all
String[] Items = {
               "Alarm",
               "Office",
               "Meeting",
               "Party",
               "Lunch",
               "Breakfast",
               "Supper",
               "Home",
               "Private",
               "Outdoor",
               "Family",
               "Friends",
               "Others"
       };
   
       Spinner s1;


and
Code: Select all
s1 = (Spinner) findViewById(R.id.spinner);
       
        ArrayAdapter<String> adapter  = new ArrayAdapter<String>(
                this,
                android.R.layout.simple_spinner_dropdown_item,
                Items);

        s1.setAdapter(adapter);
        s1.setOnItemSelectedListener(new OnItemSelectedListener()
        {
            public void onItemSelected(AdapterView<?> arg0,
            View arg1, int arg2, long arg3)
            {
                int index = s1.getSelectedItemPosition();
                Toast.makeText(getBaseContext(),
                    "You have selected item : " + Items[index],
                    Toast.LENGTH_SHORT).show();               
            }

            public void onNothingSelected(AdapterView<?> arg0) {}
        });


In it if i select the item "others" in the spinner.... the edittext has to go enable otherwise it ll be a disable.the same the edittext to get item to add spinner...

any one can help me thank you
ezhil
Freshman
Freshman
 
Posts: 3
Joined: Tue Jan 11, 2011 7:46 am

Top

Return to Advanced Tutorials

Who is online

Users browsing this forum: No registered users and 7 guests