Created
January 13, 2017 00:09
-
-
Save MarcTowler/b9f47db717e0e23d26860163a1c9881c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//First file - has all the database bits in and extends SQLiteOpenHelper | |
public Cursor queryOne(String name) { | |
SQLiteDatabase db = this.getWritableDatabase(); | |
Cursor res = db.rawQuery("SELECT type1, type2 FROM Pokemon WHERE name = ?", | |
new String[]{name}); | |
return res; | |
} | |
//second file - this pulls the data | |
protected void typeResults(String[] name) { | |
int size = name.length; | |
String[] types; | |
Cursor res = myDB.queryOne(pokemon[0]); | |
if(res != null && res.moveToFirst()) { | |
//all it seems to pull here is I/System.out: android.database.sqlite.SQLiteCursor@6d701d7 | |
System.out.println(res.toString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment