title: Two ViewPager fragments side by side will not focus EditText
body: <p>I've implemented a ViewPager that have different fragments on each page. In Portrait mode, the ViewPager displays a single fragment. In Landscape mode, the ViewPager displays two fragments side by side. I've achieved this by using the getPageWidth() override in the ViewPagerAdapter. Like this:</p>
  
  <pre><code>@Override
  public float getPageWidth(int position) {
      DisplayMetrics metrics = getResources().getDisplayMetrics();
      if ((metrics.widthPixels / metrics.density) &gt; 900) {
          return (0.5f);
      }
      return super.getPageWidth(position);
  }
  </code></pre>
  
  <p>In both fragments I have EditText fields.</p>
  
  <p>When in Landscape mode and the two fragments are sitting side by side, I can click and give focus to the EditText on the left fragment. When trying to click the EditText on the right fragment, I cannot and get the following warning in my log:</p>
  
  <blockquote>
    <p>W/IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection</p>
  </blockquote>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>public class MainActivity extends AppCompatActivity /*implements PageLoader*/ {
      MyPagerAdapter adapter;
      DirectionalViewPager pager;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          // Get the ViewPager and set it's PagerAdapter so that it can display items
          pager = (DirectionalViewPager) findViewById(R.id.vpPager);
          adapter = new MyPagerAdapter(getSupportFragmentManager());
          pager.setOffscreenPageLimit(8);
          pager.setAdapter(adapter);
      }
  
      public class MyPagerAdapter extends SmartFragmentStatePagerAdapter {
          private static final int NUM_ITEMS = 4;
  
          public MyPagerAdapter(FragmentManager fragmentManager) {
              super(fragmentManager);
          }
  
          // Returns total number of pages
          @Override
          public int getCount() {
              return NUM_ITEMS;
          }
  
          // Returns the fragment to display for that page
          @Override
          public Fragment getItem(int position) {
              switch (position) {
                  case 0: // Fragment # 0 - This will show Frag1
                      return Frag1.newInstance(position, Frag1.class.getSimpleName());
                  case 1: // Fragment # 0 - This will show Frag1 different title
                      return Frag1.newInstance(position, Frag1.class.getSimpleName());
                  case 2: // Fragment # 1 - This will show Frag2
                      return Frag2.newInstance(position, Frag2.class.getSimpleName());
                  default:
                      return Frag3.newInstance(position, Frag3.class.getSimpleName());
              }
          }
  
          // Returns the page title for the top indicator
          @Override
          public CharSequence getPageTitle(int position) {
              return "Page " + position;
  
          }
  
          @Override
          public float getPageWidth(int position) {
              DisplayMetrics metrics = getResources().getDisplayMetrics();
              if ((metrics.widthPixels / metrics.density) &gt; 900) {
                  return (0.5f);
              }
              return super.getPageWidth(position);
          }
      }
  }
  </code></pre>
  
  <p><strong>Frag1.java</strong>, <strong>Frag2.java</strong>, and <strong>Frag3.java</strong></p>
  
  <pre><code>public class Frag1 extends Fragment {
      // newInstance constructor for creating fragment with arguments
      public static Frag1 newInstance(int page, String title) {
          Frag1 fragmentFirst = new Frag1();
          Bundle args = new Bundle();
          args.putInt("someInt", page);
          args.putString("someTitle", title);
          fragmentFirst.setArguments(args);
          return fragmentFirst;
      }
      // Inflate the view for the fragment based on layout XML
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          View view = inflater.inflate(R.layout.frag1, container, false);
          return view;
      }
  }
  </code></pre>
  
  <p><strong>frag1.xml</strong>, <strong>frag2.xml</strong>, and <strong>frag3.xml</strong></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="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      android:background="#cc2"&gt;
  
      &lt;TextView
          android:id="@+id/txt_frag1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:text="txt_frag1"
          /&gt;
      &lt;Button
          android:id="@+id/btn_frag1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:text="btn_frag1"
          android:textSize="26dp" /&gt;
  
      &lt;EditText
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:id="@+id/et_frag1"
          android:ems="10"
          android:text="ET_FRAG1"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Why is it happening and how do I get around it?</p>