how to display a file in a tab view? <p>I want to display the content of a file in a tabview. Each value of the file is in an extra line. </p> <p>With this I am already able to read the file line for line: </p> <blockquote> <p>public class Tab1Activity extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.infolayout);</p> </blockquote> <pre><code> String line = ""; TextView text = new TextView(this); try { BufferedReader b = new BufferedReader(new FileReader("/sdcard/com.unitnode/debug.txt")); while ((line = b.readLine()) != null) { // liest zeilenweise aus Datei text.setGravity(Gravity.CENTER_VERTICAL); Log.d("zeile", "zeile " + line ); text.setText(line + "\r"); // setContentView(text); } b.close(); } catch (IOException e) { Log.d("fehler", "fehler "); } // ViewGroup mContainerView = (ViewGroup) findViewById(tabco); // mContainerView.addView(text); } </code></pre> <p>}</p> <p>And this is the corresponding Layout xml:</p> <blockquote> <p>TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@android:id/tabhost"></p> </blockquote> <pre><code> &lt;LinearLayout android:id="@+id/LinearLayout01" android:orientation="vertical" android:layout_height="fill_parent" android:layout_width="fill_parent"&gt; &lt;TabWidget android:id="@android:id/tabs" android:layout_height="wrap_content" android:layout_width="fill_parent"&gt; &lt;/TabWidget&gt; &lt;FrameLayout android:id="@android:id/tabcontent" android:layout_height="fill_parent" android:layout_width="fill_parent"&gt; &lt;/FrameLayout&gt; &lt;TextView android:id="@+id/text1" android:text="test" android:layout_width="wrap_content" android:layout_height="wrap_content"/&gt; &lt;/LinearLayout&gt; </code></pre> <p></p> <p>How to display the whole file in a TabView? </p> <p>EDIT: The question is not about how to create Tabs. Just how to display the file in a tab. The Tabs already exists. But my problem is, that I am only able to display one line. I want to display all lines of the file. </p> <p>Thanks</p>