Android : How can make horizontal scroll view?
<p>I am working with android, i want to make horizontal scroll view at run time, means i want to make this horizontal view by java code.</p>

<p><strong>this is my code of java class</strong></p>

<pre><code>package com.pericent;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.util.Log;
import android.widget.TabHost;

public class HelloTabWidget extends TabActivity  {

    private String TAG="HelloTabWidget";

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       // setContentView(R.layout.main);

        Resources res = getResources(); // Resource object to get Drawables
        TabHost tabHost = getTabHost();  // The activity TabHost
        TabHost.TabSpec spec;  // Resusable TabSpec for each tab
        Intent intent;  // Reusable Intent for each tab

        for(int i=0;i&lt;10;i++)
        {

        // Create an Intent to launch an Activity for the tab (to be reused)
                intent = new Intent().setClass(this,ArtistsActivity.class);
                Log.v(TAG,"---artist activity is called---");
        // Initialize a TabSpec for each tab and add it to the TabHost
                spec = tabHost.newTabSpec("artists").setIndicator("Artists",res.getDrawable(R.drawable.ic_tab_artists)).setContent(intent);
                tabHost.addTab(spec);
        }
        setContentView(tabHost);
   }
} 


this is activity ArtistActivity which  is used in above code to make Tab Widget:-
package com.pericent;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class ArtistsActivity extends Activity {
    private String TAG="ArtistsActivity";
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        TextView textview=new TextView(this);
        textview.setText("This is Artist Activity");
        setContentView(textview);
        Log.v(TAG,"---in artist activity---");
    }
}

and this is the xml file used in above code:-
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;!-- When selected, use grey --&gt;
    &lt;item android:drawable="@drawable/ic_tab_artists_grey"
          android:state_selected="true" /&gt;
    &lt;!-- When not selected, use white--&gt;
    &lt;item android:drawable="@drawable/ic_tab_artists_white" /&gt;
&lt;/selector&gt;
this above xml is used to create tab widget.

this is the output of my above code:-
</code></pre>

<p><img src="http://i.stack.imgur.com/SwN04.png" alt="enter image description here"></p>

<p>in my output all widget are displaying in the screen but i want to display 4 tabs at a time, and other must show after scrolling. So please suggest me how can i add scrollable facility in my java code  ?</p>

<p>Thank you in advance.</p>
