title: can't play multiple video using fragment
body: <p>i'm developing android app that will read an array of mp4 video path and populate each one in a fragment and play them using VideoView.</p>
  
  <p>my code works perfectly for the first fragment but not for the rest and i keep getting "Can't play this video" message.</p>
  
  <p>this is my code.</p>
  
  <p>activity</p>
  
  <pre><code>    public class SwipeActivity extends FragmentActivity  {
      private ViewPager mPager;
      private MyPageAdapter mPagerAdapter;
      static String json; 
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_screen_slide);
  
          json = "[{\"path\":\"storage\\/emulated\\/0\\/MyApp\\/VID_1.mp4\"},{\"path\":\"storage\\/emulated\\/0\\/MyApp\\/VID_2.mp4\"}]";
  
          mPager = (ViewPager) findViewById(R.id.pager);
          mPagerAdapter = new MyPageAdapter(getFragmentManager(), json);
          mPager.setAdapter(mPagerAdapter);
      }
  }
  </code></pre>
  
  <p>PageAdapter</p>
  
  <pre><code>    public class MyPageAdapter extends FragmentStatePagerAdapter {
      JSONArray jsonArray;
      FragmentManager fragmentManager;
      Context mContext;
      public MyPageAdapter(FragmentManager fm, String json) {
          super(fm);
          fragmentManager = fm;
          try {
              jsonArray = new JSONArray(json);    
          } catch (JSONException e) {
          }
  
      }
      @Override
      public Fragment getItem(int i) {
          Fragment fragment = null;
  
          JSONObject obj = null;
          String path = "";
          try {
              obj = jsonArray.getJSONObject(i);
              path = obj.getString("path");
              fragment= VideoFragment.create(i, path);
          } catch (JSONException e) {
              Log.e(TAG, "JSONException: ", e);
          }
          return fragment;
      }
      @Override
      public int getCount() {
          return jsonArray.length();
      }
  }
  </code></pre>
  
  <p>fragment</p>
  
  <pre><code>    public class VideoFragment extends Fragment {
      public static final String ARG_PAGE = "page";
      private int mPageNumber;
  
      String path;
      VideoView videoView;
      ImageView play;
      public static VideoFragment create(int pageNumber, String mpath) {
          VideoFragment fragment = new VideoFragment(mpath);
          Bundle args = new Bundle();
          args.putInt(ARG_PAGE, pageNumber);
          fragment.setArguments(args);
          return fragment;
      }
  
      public VideoFragment(String mpath) {
          path = mpath;
      }
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          mPageNumber = getArguments().getInt(ARG_PAGE);
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          // Inflate the layout containing a title and body text.
          ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_video, container, false);
  
          File file = new File(path);
          if(file.exists()) {
              path = file.getAbsolutePath();
          Log.d(TAG, "exists: " + path);
          } else {
              Log.d(TAG, "dont exists");
          }
          android.view.Display display = getActivity().getWindowManager().getDefaultDisplay();
          android.graphics.Point size = new android.graphics.Point();
          display.getSize(size);
          play = (ImageView) rootView.findViewById(R.id.play);
          videoView=(VideoView)rootView.findViewById(R.id.video);
          videoView.setVideoPath(path);
          videoView.requestFocus();
          videoView.seekTo(10);
  
          play.setColorFilter(android.graphics.Color.WHITE);
              play.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
                      Log.d(TAG, "onClick: ");
                      //play.setVisibility(View.GONE);
                      videoView.start();
                  }
              });   
          return rootView;
      }
      public int getPageNumber() {
          return mPageNumber;
      }
  }
  </code></pre>
  
  <p>what am i doing wrong?</p>