diff --git a/app/src/main/java/com/herbron/moodl/Activities/AddExchangeActivity.java b/app/src/main/java/com/herbron/moodl/Activities/AddExchangeActivity.java index 5dca0ed..424de9c 100644 --- a/app/src/main/java/com/herbron/moodl/Activities/AddExchangeActivity.java +++ b/app/src/main/java/com/herbron/moodl/Activities/AddExchangeActivity.java @@ -80,6 +80,7 @@ public class AddExchangeActivity extends AppCompatActivity { private void loadLayoutFor(int exchangeType) { setupExchangeLayout.removeAllViews(); + exchangeSpinner.setSelection(exchangeType); switch (exchangeType) { diff --git a/app/src/main/java/com/herbron/moodl/DataManagers/DatabaseManager.java b/app/src/main/java/com/herbron/moodl/DataManagers/DatabaseManager.java index ee5022c..b4a2f02 100644 --- a/app/src/main/java/com/herbron/moodl/DataManagers/DatabaseManager.java +++ b/app/src/main/java/com/herbron/moodl/DataManagers/DatabaseManager.java @@ -443,7 +443,7 @@ public class DatabaseManager extends SQLiteOpenHelper{ public List getHitBtcAccounts(Context context) { - String searchQuerry = "SELECT * FROM " + TABLE_EXCHANGE_KEYS + " WHERE " + KEY_EXCHANGE_TYPE + "='" + HITBTC_TYPE + "' AND " + KEY_EXCHANGE_IS_ENABLED + " = '1'"; + String searchQuerry = "SELECT * FROM " + TABLE_EXCHANGE_KEYS + " WHERE " + KEY_EXCHANGE_TYPE + " = " + HITBTC_TYPE + " AND " + KEY_EXCHANGE_IS_ENABLED + " = '1'"; SQLiteDatabase db = this.getWritableDatabase(); Cursor resultList = db.rawQuery(searchQuerry, null); @@ -466,7 +466,7 @@ public class DatabaseManager extends SQLiteOpenHelper{ public List getBinanceAccounts() { - String searchQuerry = "SELECT * FROM " + TABLE_EXCHANGE_KEYS + " WHERE " + KEY_EXCHANGE_TYPE + "='" + BINANCE_TYPE + "' AND " + KEY_EXCHANGE_IS_ENABLED + " = '1'"; + String searchQuerry = "SELECT * FROM " + TABLE_EXCHANGE_KEYS + " WHERE " + KEY_EXCHANGE_TYPE + " = " + BINANCE_TYPE + " AND " + KEY_EXCHANGE_IS_ENABLED + " = '1'"; SQLiteDatabase db = this.getWritableDatabase(); Cursor resultList = db.rawQuery(searchQuerry, null);