Search Results

Search found 2 results on 1 pages for 'clozecall'.

Page 1/1 | 1 

  • Hello, TabWidget each tab refer to new xml

    - by Clozecall
    Hey everyone I'm using Google's exmaple of Hello, TabWidget but altered it to look like this: main.xml: <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:text="@+layout/text" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <TextView android:id="@+id/textview2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="this is another tab" /> <TextView android:id="@+id/textview3" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="this is a third tab" /> </FrameLayout> </LinearLayout> java file: public class HelloTabWidget extends TabActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TabHost mTabHost = getTabHost(); mTabHost.addTab(mTabHost.newTabSpec("tab_test1").setIndicator("TAB 1").setContent(R.layout.text)); mTabHost.addTab(mTabHost.newTabSpec("tab_test2").setIndicator("TAB 2").setContent(R.id.textview2)); mTabHost.addTab(mTabHost.newTabSpec("tab_test3").setIndicator("TAB 3").setContent(R.id.textview3)); mTabHost.setCurrentTab(0); } } and here is the text.xml in res/layout: <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" > <TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="This is Tab 1" /> What I'm basically trying to do is have each tab refer to its own xml file rather than all in main.xml, but the text in the first tab doesn't show up.

    Read the article

  • Opening a new screen from xml file text.

    - by Clozecall
    Hey all I'm looking to edit my app so that when a text within an xml file is selected, a new window opens. I've found various ways of making a new screen open via a class, but I need it done from a xml file. My program as a tablayout, and here is some of the stuff displayed within my first tab: <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> android:id="@+id/ScrollView01" android:layout_height="wrap_content" android:layout_width="fill_parent" <TextView android:textColor="#FFFFFF" android:text="First Header here" android:textStyle="bold" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <TextView android:textColor="#FFFFFF" android:text="First body text here" android:layout_width="fill_parent" android:layout_height="wrap_content" /> So basically I need it so that when a text is selected, a new screen pops up. As said the reason this specifically has to be done in xml is because this is all apart of a tab layout, It would be great if the next within each tab could open a a new screen. Thanks.

    Read the article

1