Permalink
Browse files

text edit event added

  • Loading branch information...
1 parent 3e4168a commit bed98db641925becc6c1a33031a03fabedd8dc49 @sergkh committed Oct 8, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/ua/stldev/pharm/ItemsSearchActivity.java
@@ -6,6 +6,7 @@
import android.database.Cursor;
import android.os.Bundle;
import android.util.Log;
+import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@@ -17,6 +18,7 @@
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;
+import android.widget.TextView.OnEditorActionListener;
public class ItemsSearchActivity extends Activity implements
OnItemLongClickListener {
@@ -39,6 +41,13 @@ public void onCreate(Bundle savedInstanceState) {
searchText = (EditText) findViewById(R.id.searchField);
itemsList = (ListView) findViewById(R.id.foundItemsList);
itemsList.setOnItemLongClickListener(this);
+
+ searchText.setOnEditorActionListener(new OnEditorActionListener() {
+ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+ search(searchText);
+ return true;
+ }
+ });
}
@Override

0 comments on commit bed98db

Please sign in to comment.