title: Horizontal Scrollable Tabs Using FragmentTabHost In A Class That Extends Fragment
body: <p>I am using a class that extends <code>Fragment</code> and not <code>FragmentActivity</code> and I cannot seem to make horizontal scroll to work. I first used a layout as simple as the first code below and it works perfectly (without the scroll of course). I decided to put a horizontal scroll because when my tab reaches 6, the text is so hard to read and when the text is too long, the complete text is not written. I tried to use the layout of other people that said "This works!". Please refer to the second code below; the third code is my fragment class. Thank you!   </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"/&gt;
  </code></pre>
  
  <p>The layout that other people said "It works"</p>
  
  <pre><code>&lt;android.support.v4.app.FragmentTabHost xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@android:id/tabhost"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical" &gt;
  
          &lt;HorizontalScrollView
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:fillViewport="true"
              android:scrollbars="none" &gt;
  
              &lt;TabWidget
                  android:id="@android:id/tabs"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_gravity="bottom" /&gt;
  
          &lt;/HorizontalScrollView&gt;
  
          &lt;FrameLayout
              android:id="@android:id/tabcontent"
              android:layout_width="match_parent"
              android:layout_height="0dp"
              android:layout_weight="1" /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/android.support.v4.app.FragmentTabHost&gt;
  </code></pre>
  
  <p>Lastly, my <code>Fragment</code> class. Maybe I'm missing something out?</p>
  
  <pre><code>public class AlarmTab extends Fragment {
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          FragmentTabHost tabHost;
          tabHost = new FragmentTabHost(getActivity());
          tabHost.setup(getActivity(), getChildFragmentManager(), R.layout.alarm_tab);
  
  
          for(int i=0; i&lt;SmashDeviceData.get_instance().devices.size(); i++) {
              Bundle bundle = new Bundle();
              bundle.putInt("Arg for Frag" + i, 1);
              tabHost.addTab(tabHost.newTabSpec("Tab"+i).setIndicator(SmashDeviceData.get_instance().devices.get(i).deviceName), AlarmActivity.class, bundle);
          }
              return tabHost;
      }
  
  
      public static Fragment newInstance() {
          Fragment fragment = new AlarmTab();
          return fragment;
      }
  }
  </code></pre>