Code example for EditText

Methods: getTextgetSelectionStart

0
	// =========================================================== 
	// Methods 
	// =========================================================== 
 
	protected String getCurrent(){
		final int selStart = this.mEditText.getSelectionStart();
		//		Log.d(DEBUGTAG, "SelStart: " + selStart); 
		if(selStart >= 0) {
			return this.mEditText.getText().toString().substring(0, selStart);
		} else { 
			return this.mEditText.getText().toString();
		} 
	} 
 
	private void complete(final String aCandidate){
		this.mEditText.post(new Runnable(){
			@Override 
			public void run() { 
				final String strBefore = InlineAutoCompleterDynamic.this.getCurrent();
 
				/* The Content of the EditText may have changed since the candidate was determined. */