title: Swiping through unlimited fragments - Confused over ViewPager process
body: <p>I am trying to create an app that pulls these Ron Swanson quotes from an api and displays them in a fragment. When the fragment is swiped, the app will go to another fragment and display a new quote. This process is supposed to repeat indefinitely. </p>
  
  <p>Instead, the app loads to a blank screen. I have placed a button and TextView on the fragment, each with initial texts to determine if it has loads, but nothing ever appears. </p>
  
  <p>P.S.: you may also notice some <em>comical</em> variable names and comments. I obviously didn't consider that I may need help when writing it (it's just a personal app for learning). </p>
  
  <p>P.P.S.: I'm honestly not certain the site is even still up, but that shouldn't affect anything at this point.</p>
  
  <p>Thanks to anyone who can help. Below is the 1) single java file of the app 2) activity_main.xml file.</p>
  
  <pre><code>    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
      public class MainActivity extends FragmentActivity {
  
          @SuppressWarnings("deprecation")
          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_main);
  
              //
              ViewPager pagingRon = (ViewPager) findViewById(R.id.pager);
              PagerAdapter RonsPagerAdapter = new CustomPagerAdapter(getSupportFragmentManager());
              pagingRon.setAdapter(RonsPagerAdapter);
              pagingRon.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
  
                  @Override
                  public void onPageScrollStateChanged(int arg0) {
                      // TOxDO Auto-generated method stub
  
                  }
  
                  @Override
                  public void onPageScrolled(int arg0, float arg1, int arg2) {
                      // TODO Auto-generated method stub
  
                  }
  
                  @Override
                  public void onPageSelected(int arg0) {
                      // TODO Auto-generated method stub
  
                  }
              });
  
              //Initial AsyncTask for setting up first quote of the Great Swan
              RonSwanSetup ronSwansonOG = new RonSwanSetup();
              ronSwansonOG.execute();
          }
  
          private class RonSwanSetup extends AsyncTask&lt;Void, String, Void&gt; {
  
              @Override
              protected Void doInBackground(Void... Socialism) {
                  String Ronquoteson = ""; //Ron's wonderful first quote
                  String Rondotcom = "http://ron-swanson-quotes.herokuapp.com/quotes"; //the website for fetching Ron's wonderful quotes
                  String[] Ronsquotes = new String[1]; //Ron only speaks seldomly, which is the pinnacle of wisdom
  
  
                  try {
                      URL Ronsurl = new URL(Rondotcom);
                      HttpURLConnection Ronsconnection = (HttpURLConnection) Ronsurl.openConnection();
  
                      BufferedReader thanksRon = new BufferedReader(new InputStreamReader(Ronsconnection.getInputStream()));
                      String current;
  
                      while((current = thanksRon.readLine()) != null)
                      {
                          Ronquoteson += current;
                      }
  
                      Ronsquotes[0] = Ronquoteson;
  
                  } catch (Exception sorryRon) {
                      Ronsquotes[0] = "The app appears unable to do even the SIMPLEST THINGS CORRECTLY - Maybe try restarting it?";
                      sorryRon.printStackTrace();
                  }
  
                  publishProgress(Ronsquotes);
  
                  return null;
              }
  
              protected void onProgressUpdate(String... Ronsquote) {
                  TextView RonsText = (TextView) findViewById(R.id.text);
  
                  String RonQouteson = Ronsquote[0];
                  RonsText.setText("Not Ron's Quote");//For testing
  
              }
          }
  
          public class CustomPagerAdapter extends FragmentPagerAdapter {
  
              public CustomPagerAdapter(FragmentManager fm) {
                  super(fm);
              }
  
              @Override
              // This method returns the fragment associated with
              // the specified position.
              // It is called when the Adapter needs a fragment
              // and it does not exist.
              public Fragment getItem(int position) {
  
                  // Create fragment object
                  RonFragSon fragment = new RonFragSon();
  
                  // Attach some data to it that we'll
                  // use to populate our fragment layouts
                  Bundle args = new Bundle();
                  args.putInt("page_position", position + 1);
  
                  // Set the arguments on the fragment
                  // that will be fetched
                  fragment.setArguments(args);
  
                  return fragment;
              }
  
              @Override
              public int getCount() {
                  return 3;
              }
  
          }
  
          public class RonFragSon extends Fragment {
  
              @Override
              public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
                  // Inflate the layout resource that'll be returned
                  View rootView = inflater.inflate(R.layout.swansons_fragment, container, false);
  
                  // Get the arguments that was supplied when
                  // the fragment was instantiated in the
                  // CustomPagerAdapter
                  Bundle args = getArguments();
                  ((TextView) rootView.findViewById(R.id.text)).setText("Page");
  
                  return rootView;
              }
          }
      }
  </code></pre>
  
  <hr>
  
  <pre><code>    &lt;HorizontalScrollView
          android:id="@+id/horizontal_Swangrid"
          android:layout_width="wrap_content"
          android:layout_height="0dp"
          android:layout_weight="40" 
          xmlns:android="http://schemas.android.com/apk/res/android"&gt;
          &lt;!--   I don't think this is necessary, but don't want to get rid of it in case I'm wrong
          &lt;LinearLayout
              android:id="@+id/Swanson_cant_container"
              android:layout_width="wrap_content"
              android:layout_height="match_parent"
              android:orientation="horizontal" &gt;
              &lt;TextView 
                  android:id="@+id/RonSwan1stQuote"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"/&gt;
             &lt;TextView 
                  android:id="@+id/RonSwan2ndQuote"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"/&gt;
              &lt;TextView 
                  android:id="@+id/RonSwan3rdQuote"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"/&gt;
  
          &lt;/LinearLayout&gt;
      --&gt;
          &lt;android.support.v4.view.ViewPager
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/pager"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
      &lt;/HorizontalScrollView&gt;
  </code></pre>