Exemplo n.º 1
0
  @Override
  public void onPageSelected(int index) {
    this.index = index;

    txtStatus.setText(getStatus(index).getText());

    if (getSupportActionBar() != null)
      getSupportActionBar().setTitle(String.format("%d/%d", index + 1, size()));

    PictureFragment fragment = (PictureFragment) myViewPagerAdapter.getItem(index);
    if (fragment != null) fragment.onTabRequestData();

    Intent data = new Intent();
    data.putExtra("index", viewPager.getCurrentItem());
    setResult(Activity.RESULT_OK, data);
  }
Exemplo n.º 2
0
 protected Fragment newFragment(int position) {
   return PictureFragment.newInstance(getPicture(position));
 }