Guest User

Untitled

a guest
Jan 20th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. String enStr = "en", deStr= "de";
  2. String[] projection = {
  3. _id,
  4. en_word,
  5. de_word};
  6.  
  7. String selection = "translate_id = ?" + " AND "
  8. + "en_id = ?" + " AND "
  9. + "de_id = ? ";
  10. String[] selectionArgs = { String.valueOf("1"), "en", "de" };
  11.  
  12. return new CursorLoader(this, // Parent activity context
  13. currentUri,
  14. projection, // Columns to include in the resulting Cursor
  15. selection, // No selection clause
  16. selectionArgs, // No selection arguments
  17. null); // Default sort order
  18.  
  19. SELECT
  20. _id, en_word, de_word
  21. from
  22. translate, en, de
  23. WHERE
  24. translate_id = 1 AND en_id = ? AND de_id = ?;
  25.  
  26. String enStr = "en", deStr= "de";
  27. String selection = "translate_id = 1" + " AND "
  28. + "en_id = " + enStr + " AND "
  29. + "de_id = ? " + deStr;
  30.  
  31. return new CursorLoader(this, // Parent activity context
  32. currentUri,
  33. projection, // Columns to include in the resulting Cursor
  34. selection, // No selection clause
  35. null, // No selection arguments
  36. null); // Default sort order
  37.  
  38. SELECT
  39. _id, en_word, de_word
  40. from
  41. translate, en, de
  42. WHERE
  43. translate_id = 1 AND en_id = en AND de_id = de;
Add Comment
Please, Sign In to add comment