Permalink
Browse files

fixing Issue #321. Previously Searched Authors care now shown on list

  • Loading branch information...
1 parent 0d673d0 commit 45381d29c44cce1482c3c0a7ae3a918fd0c387cc @filipeximenes filipeximenes committed Jun 21, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/com/eleybourn/bookcatalogue/BookISBNSearch.java
@@ -240,7 +240,7 @@ public void onClick(View view) {
} else if (by.equals("name")) {
// System.out.println(mId + " OnCreate BY NAME");
setContentView(R.layout.name_search);
- ArrayAdapter<String> author_adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, mDbHelper.getAllAuthors());
+ final ArrayAdapter<String> author_adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, mDbHelper.getAllAuthors());
mAuthorText = (AutoCompleteTextView) findViewById(R.id.author);
mAuthorText.setAdapter(author_adapter);
@@ -251,6 +251,11 @@ public void onClick(View view) {
public void onClick(View view) {
String mAuthor = mAuthorText.getText().toString();
String mTitle = mTitleText.getText().toString();
+
+ if (author_adapter.getPosition(mAuthor) < 0){
+ author_adapter.add(mAuthor);
+ }
+
go("", mAuthor, mTitle);
}
});

0 comments on commit 45381d2

Please sign in to comment.