title: How to scroll on particular position in HorizontalScrollView Android
body: <p>I am adding Dynamic layout view in LinearLayout inside HorizontalScrollView.
  Layout xml are as below:</p>
  
  <pre><code>  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"&gt;
  
  &lt;HorizontalScrollView
      android:id="@+id/hsv_category_list"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:scrollbars="none"&gt;
  
      &lt;LinearLayout
          android:id="@+id/ll_placeHolder"
          android:layout_width="wrap_content"
          android:layout_height="100dp"
          android:orientation="horizontal"&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/HorizontalScrollView&gt;
  </code></pre>
  
  <p></p>
  
  <p>By pragmatically adding 10 Views in Linear Layout as below</p>
  
  <pre><code>public class ScrollTest extends Activity {
  
    HorizontalScrollView hsv_category_list;
    LinearLayout ll_placeHolder;
    View layoutView[];
   @Override
  protected void onCreate(@Nullable Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.scroll_test);
      hsv_category_list=
     (HorizontalScrollView)findViewById(R.id.hsv_category_list);
      ll_placeHolder = (LinearLayout) findViewById(R.id.ll_placeHolder);
      layoutView = new View[10];
  
      for (int i = 0; i &lt; 10; i++) {
          layoutView[i] = 
          LayoutInflater.from(this).inflate(R.layout.category_list_item, 
          null);
          layoutView[i].setId(i);
  
          ll_placeHolder.addView(layoutView[i]);
      }
  
      }
   }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/T4C34.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T4C34.png" alt="output"></a></p>
  
  <p>I want to auto scroll to item on index 7 which is not visible.
  Please help me out to solve this.Thank you</p>