SHARE
TWEET

FullScreenViewActivity

shifarshifz Apr 7th, 2015 (edited) 2,523 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         package info.androidhive.imageslider;
  2.  
  3. import info.androidhive.imageslider.adapter.FullScreenImageAdapter;
  4. import info.androidhive.imageslider.helper.Utils;
  5. import android.app.Activity;
  6. import android.content.Intent;
  7. import android.os.Bundle;
  8. import android.support.v4.view.ViewPager;
  9.  
  10. public class FullScreenViewActivity extends Activity{
  11.  
  12.         private Utils utils;
  13.         private FullScreenImageAdapter adapter;
  14.         private ViewPager viewPager;
  15.  
  16.         @Override
  17.         protected void onCreate(Bundle savedInstanceState) {
  18.                 super.onCreate(savedInstanceState);
  19.                 setContentView(R.layout.activity_fullscreen_view);
  20.  
  21.                 viewPager = (ViewPager) findViewById(R.id.pager);
  22.  
  23.                 utils = new Utils(getApplicationContext());
  24.  
  25.                 Intent i = getIntent();
  26.                 int position = i.getIntExtra("position", 0);
  27.  
  28.                 adapter = new FullScreenImageAdapter(FullScreenViewActivity.this,
  29.                                 utils.getFilePaths());
  30.  
  31.                 viewPager.setAdapter(adapter);
  32.  
  33.                 // displaying selected image first
  34.                 viewPager.setCurrentItem(position);
  35.         }
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top