Advertisement
minafaw3

Consens_test_handler

Oct 19th, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. package com.imaadv.leaynik.Activities;
  2.  
  3. import android.os.Bundle;
  4. import android.support.v4.app.Fragment;
  5. import android.support.v4.app.FragmentManager;
  6. import android.support.v7.app.AppCompatActivity;
  7.  
  8. import com.imaadv.leaynik.R;
  9. import com.imaadv.leaynik.api.API;
  10. import com.imaadv.leaynik.defs.AppConstants;
  11. import com.imaadv.leaynik.defs.Test_Question;
  12. import com.imaadv.leaynik.test.Question_Module_Test;
  13.  
  14. import java.util.ArrayList;
  15.  
  16. /**
  17. * Created by NT on 10/19/15.
  18. */
  19. public class Consens_test_handler extends AppCompatActivity {
  20.  
  21. int Image_Test_One = R.drawable.visial_test_06;
  22. int Image_Test_Two = R.drawable.visial_test_7;
  23. int Image_Test_Three = R.drawable.visial_test_8;
  24. int Image_Test_Four = R.drawable.visial_test_11;
  25. int Image_Test_Five = R.drawable.visial_test_06;
  26.  
  27. private ArrayList<Test_Question> items;
  28. private API _api;
  29.  
  30.  
  31. @Override
  32. protected void onCreate(Bundle savedInstanceState) {
  33. super.onCreate(savedInstanceState);
  34. setContentView(R.layout.checks_activity);
  35. _api = new API(this);
  36. _api.setSetting(AppConstants.CURRENT_QUESTION_SCORE, "0");
  37.  
  38. display_tests();
  39. }
  40.  
  41. private void display_tests() {
  42. items = new ArrayList<Test_Question>(5);
  43. items.add(new Test_Question(AppConstants.CONSENS, AppConstants.QUESTION_ONE, Image_Test_One, Question_Module_Test.TEST_MODULE_TWO));
  44. items.add(new Test_Question(AppConstants.CONSENS, AppConstants.QUESTION_TWO, Image_Test_Two, Question_Module_Test.TEST_MODULE_TWO));
  45. items.add(new Test_Question(AppConstants.CONSENS, AppConstants.QUESTION_THREE, Image_Test_Three, Question_Module_Test.TEST_MODULE_TWO));
  46. items.add(new Test_Question(AppConstants.CONSENS, AppConstants.QUESTION_FOUR, Image_Test_Four, Question_Module_Test.TEST_MODULE_TWO));
  47. items.add(new Test_Question(AppConstants.CONSENS, AppConstants.QUESTION_FIVE, Image_Test_Five, Question_Module_Test.TEST_MODULE_TWO));
  48.  
  49.  
  50. Bundle bundle = new Bundle();
  51. bundle.putParcelableArrayList(Question_Module_Test.QUESTION_TAG_KEY, items);
  52. bundle.putString(AppConstants.CURRENT_QUESTION_POS, "0");
  53.  
  54. Fragment fragment = new Question_Module_Test();
  55. fragment.setArguments(bundle);
  56.  
  57. FragmentManager fm = getSupportFragmentManager();
  58. fm.beginTransaction().replace(R.id.frame_container ,fragment).commit();
  59.  
  60.  
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement