Code example for AutoCompleteTextView

Methods: getAdapter

0
 
		m_to.setOnKeyListener(new View.OnKeyListener() {
			public boolean onKey(View v, int keyCode, KeyEvent event) {
				m_number = "";
				if (keyCode == KeyEvent.KEYCODE_ENTER) {
					ListAdapter adapter = m_to.getAdapter();
					if (adapter.getCount() > 0) {
						Cursor c = (Cursor) adapter.getItem(0);
						c.moveToFirst();
						m_number = c.getString(3);
						m_to.setText(c.getString(5));
					} 
					m_message.requestFocus();
					updateCounter(); 
					return true; 
				} 
				return false; 
			} 
		}); 
		initUI(); 
Stop searching for code, let great code find you!  Add Codota to your java IDE