public void initViewPager() {
   ViewPager mViewPager = (ViewPager) findViewById(R.id.slider_posters);
   MyPagerAdapter pagerAdapter = new MyPagerAdapter();
   mViewPager.setAdapter(pagerAdapter);
   CircleIndicator defaultIndicator = (CircleIndicator) findViewById(R.id.indicator);
   defaultIndicator.setViewPager(mViewPager);
 }
Example #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_spo2);
    toolbar = (Toolbar) findViewById(R.id.my_toolbar);
    setSupportActionBar(toolbar);
    // getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    CircleIndicator myIndicator = (CircleIndicator) findViewById(R.id.indicator_spo2);
    ViewPagerAdapterSpO2 adapter = new ViewPagerAdapterSpO2(getSupportFragmentManager());
    ViewPager pager = (ViewPager) findViewById(R.id.pager_spo2);
    pager.setAdapter(adapter);
    myIndicator.setViewPager(pager);

    buttonGoal = (Button) findViewById(R.id.button_goal);
    buttonGoal.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent intent = new Intent(SPO2.this, GoalApplication.class);
            startActivity(intent);
            SPO2.this.finish();
          }
        });
    buttonWakeup = (Button) findViewById(R.id.button_wakeup);
    buttonWakeup.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent intent = new Intent(SPO2.this, WakeupApplication.class);
            startActivity(intent);
            SPO2.this.finish();
          }
        });
    buttonIntense = (Button) findViewById(R.id.button_intense);
    buttonIntense.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent intent = new Intent(SPO2.this, IntenseApplication.class);
            startActivity(intent);
            SPO2.this.finish();
          }
        });
    /*test = (Button)findViewById(R.id.start_test);
    test.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            MainActivity.SendMorSensorCommands(MainActivity.SEND_MORSENSOR_FILE_DATA_SIZE); //SEND_MORSENSOR_FILE_DATA_SIZE
            Intent intent = new Intent(SPO2.this, result.class);
            startActivity(intent);
            SPO2.this.finish();

        }
    });*/

    SharedPreferences settings = getSharedPreferences(Login.LOGIN, 0);
    String user = settings.getString(Login.USER, "");
    String pwd = settings.getString(Login.PASS, "");
    get(user);
  }