Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. protected void onCreate(Bundle savedInstanceState)
  2. {
  3. super.onCreate(savedInstanceState);
  4. setContentView(R.layout.play_activity);
  5.  
  6. //connect the view to the code
  7. backButton = findViewById(R.id.backPlayButton);
  8. addButton = findViewById(R.id.addButton);
  9. addButton.setOnClickListener(addMore);
  10. }
  11. public View.OnClickListener addMore = new View.OnClickListener()
  12. {
  13. @Override
  14. public void onClick(View v)
  15. {
  16. categoryString = categorySpinner.getSelectedItem().toString();
  17. // categoryURLNum = 0;
  18. Log.d("thing","The Category is: " + categoryString);
  19. // if(categoryString != "Any Category")
  20. // {
  21. if(categoryString.equals("General Knowledge"))
  22. {
  23. databaseHelper.setCategoryNum(9);
  24. Log.d("category", "in if: " + databaseHelper.getCategoryNum());
  25. }
  26. Log.d("category", "after if: " + databaseHelper.getCategoryNum());
  27.  
  28. updateURLwithCategory(databaseHelper.getCategoryNum());
  29. Log.d("category", "after updateUrlwithCategory: " + OPEN_TRIVIA_URL);
  30.  
  31. databaseHelper.clearDB();
  32. finish();
  33. overridePendingTransition(0, 0);
  34. startActivity(getIntent());
  35. overridePendingTransition(0, 0);
  36. }
  37. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement