Code example for EditText

Methods: requestFocus, setVisibility

0
        mFoldersSpinner.setOnItemSelectedListener(new OnItemSelectedListener() {
 
			@Override 
			public void onItemSelected(AdapterView<?> arg0, View arg1, int position, long id) {
				if (position == 0) {
					mNewFolderName.setVisibility(View.VISIBLE);
					mNewFolderName.requestFocus();
				} else { 
					mNewFolderName.setVisibility(View.GONE);
				} 
			} 
 
			@Override 
			public void onNothingSelected(AdapterView<?> arg0) { }
		}); 
         
        // Default to root folder. 
        mFoldersSpinner.setSelection(1);
         
        mNewFolderName = (EditText) findViewById(R.id.EditBookmarkActivity_FolderValue);