Hello all this is my code for the tab layout in to android i want them in to bottom of the scrren currently it shows me at top of the screen
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_alignParentBottom="true"
android:gravity="bottom">
<TabHost android:id="#android:id/tabhost" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<HorizontalScrollView android:scrollbars="none"
android:layout_width="fill_parent" android:layout_height="wrap_content">
<TabWidget android:id="#android:id/tabs"
android:layout_alignParentBottom="true" android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</HorizontalScrollView>
<FrameLayout android:id="#android:id/tabcontent"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:padding="5dp" />
</LinearLayout>
</TabHost>
</LinearLayout>
tab.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:background="#drawable/tab_background_selector" android:gravity="center"
android:orientation="vertical" android:padding="5dp"
android:layout_alignParentBottom="true" >
<ImageView android:id="#+id/tab_icon" android:layout_width="30dp"
android:layout_height="30dp" android:scaleType="fitCenter" />
<TextView android:id="#+id/tab_text" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:singleLine="true"
android:textStyle="bold" android:gravity="center_horizontal"
android:textSize="10sp" android:padding="3dip" android:ellipsize="marquee"
android:textColor="#drawable/tab_text_selector"
android:layout_alignParentBottom="true" />
</LinearLayout>
this is my activity class
TestActivity.java
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TabHost;
import android.widget.TextView;
import android.widget.TabHost.TabSpec;
public class TestActivity extends TabActivity {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.maiin);
final TabHost tabHost = (TabHost) getTabHost();
tabHost.addTab(createTab(MobiintheMorningActivity.class,
"Welcome", "Welcome", R.drawable.icon));
tabHost.setCurrentTab(0);
tabHost.getTabWidget().getChildAt(0).getLayoutParams().width = 85;
}
private TabSpec createTab(final Class<?> intentClass, final String tag,
final String title, final int drawable)
{
final Intent intent = new Intent().setClass(this, intentClass);
final View tab = LayoutInflater.from(getTabHost().getContext()).
inflate(R.layout.tab, null);
((TextView)tab.findViewById(R.id.tab_text)).setText(title);
((ImageView)tab.findViewById(R.id.tab_icon)).setImageResource(drawable);
return getTabHost().newTabSpec(tag).setIndicator(tab).setContent(intent);
}
}
here i've used android:layout_alignParentBottom="true" but no effects at all what should i do? what thing i am missing? thanks in advance :Pragna
See the solution to put the tab bar at the bottom.
Change the position of FrameLayout and widget in your xml.I think that my help you
Related
I want to change text in my tab Bar to get text in singleLine and remove the bold style but how to do it ? Please show me the good way
My below code don't change anything...
Here my XMl code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TabHost
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/tabHost"
android:layout_gravity="right">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TabWidget
android:id="#android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"></TabWidget>
<FrameLayout
android:id="#android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:id="#+id/text1"
android:text="#string/text_v1"/>
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:id="#+id/text2"
android:text="#string/text_v2"/>
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:id="#+id/text3"
android:text="#string/text_v3"/>
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:id="#+id/text4"
android:text="#string/text_v4"/>
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout5"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:id="#+id/text5"
android:text="#string/text_v5"/>
</LinearLayout>
</FrameLayout>
</LinearLayout>
</TabHost>
</LinearLayout>
Here the java code:
package com.atonfoaziz.tabs5;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Build;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.TabHost;
import android.widget.TabWidget;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
TabHost tabHost;
TabHost.TabSpec spec;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tabHost = (TabHost)findViewById(R.id.tabHost);
if (tabHost != null){
tabHost.setup();
spec = tabHost.newTabSpec("Tab I").setContent(R.id.linearLayout1).setIndicator("Contacts");
tabHost.addTab(spec);
spec = tabHost.newTabSpec("Tab II").setContent(R.id.linearLayout2).setIndicator("Calls");
tabHost.addTab(spec);
spec = tabHost.newTabSpec("Tab III").setContent(R.id.linearLayout3).setIndicator("Discussions");
tabHost.addTab(spec);
spec = tabHost.newTabSpec("Tab IV").setContent(R.id.linearLayout4).setIndicator("Research");
tabHost.addTab(spec);
spec = tabHost.newTabSpec("Tab V").setContent(R.id.linearLayout5).setIndicator("Settings");
tabHost.addTab(spec);
TabWidget widget = tabHost.getTabWidget();
int tabCount = widget.getTabCount();
for (int i = 0; i < tabCount; i++){
View view = widget.getChildTabViewAt(i);
if (view != null){
TextView textView = (TextView)findViewById(R.id.title);
if (textView != null){
textView.setAllCaps(false);
textView.setSingleLine(true);
textView.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
if (Build.VERSION.SDK_INT < 23){
textView.setTextAppearance(this, R.style.tab_appereance);
} else {
textView.setTextAppearance(R.style.tab_appereance);
}
textView.setTextSize(16);
}
}
}
}
}
}
I'm having difficulty getting the layout_height right inflating a PreferenceFragment onto a CardView.
Everything works well, including the NestedScrollView to collapse my Toolbar, but for some reason my Preferences are only filling the first position of the list. It's scrollable, but it needs to fill the entire Card.
Any ideas on what might be going on here?
Edit: It's definitely the NestedScrollView causing the problem. Now if only I can find a workaround..
I might also not fully understand Cards, since other Layouts, I can't seem to get them to entirely fill the View, minus that little bit of margin.
Here's my PreferenceFragment XML
<android.support.v7.widget.CardView
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/tools"
android:id="#+id/cardview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:elevation="100dp"
android:layout_gravity="center"
android:layout_margin="10dp"
card_view:cardBackgroundColor="#color/cardview_initial_background"
card_view:cardCornerRadius="10dp"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<android.support.v4.widget.NestedScrollView
android:id="#+id/nestedScrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="#dimen/scrollview_padding_default" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:background="#android:color/transparent">
<ListView
android:id="#android:id/list"
android:layout_width="fill_parent"
android:layout_height="0px"
android:layout_weight="1"
android:paddingTop="0dip"
android:paddingBottom="#dimen/preference_fragment_padding_bottom"
android:paddingLeft="#dimen/preference_fragment_padding_side"
android:paddingRight="#dimen/preference_fragment_padding_side"
android:scrollbarStyle="#integer/preference_fragment_scrollbarStyle"
android:clipToPadding="false"
android:drawSelectorOnTop="false"
android:cacheColorHint="#android:color/transparent"
android:scrollbarAlwaysDrawVerticalTrack="true" />
<TextView
android:id="#android:id/empty"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="#dimen/preference_fragment_padding_side"
android:gravity="center"
android:visibility="gone" />
<RelativeLayout
android:id="#+id/button_bar"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_weight="0"
android:visibility="gone">
<Button
android:id="#+id/back_button"
android:layout_width="150dip"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:layout_alignParentLeft="true"
android:text="#string/back_button_label"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true">
<Button
android:id="#+id/skip_button"
android:layout_width="150dip"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:text="#string/skip_button_label"
android:visibility="gone"/>
<Button
android:id="#+id/next_button"
android:layout_width="150dip"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:text="#string/next_button_label"/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.v7.widget.CardView>
And my PreferenceFragment Java, where the inflation happens:
package app.my.sample;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import app.my.sample.R;
public class SettingsPreferenceFragment extends PreferenceFragment {
public static final String ARG_PAGE = "ARG_PAGE";
private int mPage;
public static SettingsPreferenceFragment newInstance(int page) {
Bundle args = new Bundle();
args.putInt(ARG_PAGE, page);
SettingsPreferenceFragment fragment = new SettingsPreferenceFragment();
fragment.setArguments(args);
return fragment;
}
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mPage = getArguments().getInt(ARG_PAGE);
addPreferencesFromResource(R.xml.preferences);
}
#Override
public View onCreateView(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, Bundle paramBundle) {
return paramLayoutInflater.inflate(R.layout.fragment_preference_list, paramViewGroup , false);
//return super.onCreateView(paramLayoutInflater, paramViewGroup, paramBundle);
}
}
It's an old question but maybe someone will find this answer useful.
Try Adding attribute android:fillViewport="true" to NestedScrollView.
I wonder if I can use MINI_THUMB_MAGIC from MediaStore.Images.Media to create the Uri for the thumbnails, for example something like below:
"content://media/external/images/thumbnails/" + "kind_mini" +"/"+ thumbId
JAVA
package app.test;
import android.app.Activity;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.widget.ImageView;
public class Test extends Activity {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ImageView imgView = (ImageView) findViewById(R.id.image3);
imgView.setImageURI(Uri.parse("file://mnt/sdcard/d2.jpg"));
}
}
XML
<?xml version="1.0" encoding="utf-8"?>
<!-- This file is at /res/layout/list.xml -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content" android:layout_height="fill_parent">
<ImageView android:id="#+id/image1"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:src="#drawable/icon"
/>
<ImageView android:id="#+id/image2"
android:layout_width="125dip" android:layout_height="25dip"
android:src="#555555"
/>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content" android:layout_height="fill_parent">
<ImageView android:id="#+id/image3"
android:layout_width="wrap_content" android:layout_height="wrap_content"
/>
<ImageView android:id="#+id/image4"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:src="#drawable/icon"
android:scaleType="centerInside"
android:maxWidth="35dip" android:maxHeight="50dip"
/>
</LinearLayout>
</LinearLayout>
I have the following code that is a dynamic listview where you type in the textbox and click the add button and its added to the listview below. Listview is a custom listview with 2 textviews. Somehow the code adds the first item and then does not add the rest. The arraylist gets the item, i call adapter.notifyDataSetChanged(); and yet still the listview does not get updated. What am i doing wrong?
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
public class ManageComplaintsActivity extends DashboardActivity {
EditText txtAddComplaint;
ListView lvComplaintsList;
Button btnAddComplaint;
private SimpleAdapter adapter;
private int count = 1;
private ArrayList<Map<String, String>> list = new ArrayList<Map<String, String>>();;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_manage_complaints);
setTitleFromActivityLabel (R.id.title_text);
txtAddComplaint= (EditText) findViewById(R.id.txtAddComplaint);
lvComplaintsList= (ListView) findViewById(R.id.lvComplaintsList);
btnAddComplaint = (Button)findViewById(R.id.btnAddComplaint);
String[] from = { "complaint", "complaintid" };
int[] to = { R.id.lblC, R.id.lblCID };
adapter = new SimpleAdapter (this, list, R.layout.activity_manage_complaints_row, from, to);
lvComplaintsList.setAdapter(adapter);
btnAddComplaint.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
HashMap<String, String> item = new HashMap<String, String>();
item.put("complaint", txtAddComplaint.getText().toString());
item.put("complaintid", Integer.toString(count));
list.add(item);
adapter.notifyDataSetChanged();
count++;
txtAddComplaint.setText("");
Toast.makeText(getApplicationContext(),Integer.toString(list.size()), Toast.LENGTH_SHORT).show();
}
});
lvComplaintsList.setOnItemClickListener(new OnItemClickListener(){
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText(getApplicationContext(),
((TextView)view.findViewById(R.id.lblC)).getText(), Toast.LENGTH_SHORT).show();
}
});
}
}
This is the 2 xml files
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical" >
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dip"
android:shrinkColumns="1"
android:stretchColumns="1" >
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<EditText
android:id="#+id/txtAddComplaint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3" />
<Button
android:id="#+id/btnAddComplaint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Add" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/txtComplaintLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="List of Complaints : "
android:textAppearance="?android:attr/textAppearanceLarge"
android:paddingBottom="20dp"/>
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ListView
android:id="#+id/lvComplaintsList"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_span="2" />
</TableRow>
</TableLayout>
</ScrollView>
</LinearLayout>
This is the listviewrow xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="#+id/lblC"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
/>
<TextView
android:id="#+id/lblCID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
/>
</RelativeLayout>
As you can see in documentation to SimppleAdapter it is
An easy adapter to map static data to views defined in an XML file.
I believe that you can find any tricky way to add data dynamically. But I'm not sure that you have to do it like this. Try to use ArrayAdapter instead. By default it binds T.toString() values to single TextView, but you can override getView(int, View, ViewGroup) to return the type of view you want.
I changed the main xml file as follows
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/LinearLayout02"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<EditText
android:id="#+id/txtAddComplaint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" >
</EditText>
<Button
android:id="#+id/btnAddComplaint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Add to Listview" >
</Button>
</LinearLayout>
<ListView
android:id="#+id/lvComplaintsList"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
I had used a table layout and the listview was in one of the rows.
Hope this helps someone .
My question:
How do i view the lists for each tab separately? If I run it as is, when i select brooklyn, the same list from bronx displayed.
Another question. How do i make it so when i run the program, the list does not appear until you select whatever tab i choose.
package com.MTA_Transit;
import android.app.Activity;
import android.app.TabActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TabHost;
public class MTA_Transit extends TabActivity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TabHost mTabHost = getTabHost();
ListView bronx=(ListView)findViewById(R.id.bronx);
ListView brooklyn=(ListView)findViewById(R.id.brooklyn);
ArrayAdapter<String> adapter = new ArrayAdapter<String> (this,android.R.layout.simple_list_item_1,BRONX);
bronx.setAdapter(adapter);
ArrayAdapter<String> adapter1 = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,BROOKLYN);
brooklyn.setAdapter(adapter);
//Bronx Tab
mTabHost.addTab(mTabHost.newTabSpec("").setIndicator("Bronx",getResources().getDrawable(R.drawable.tab_one))
.setContent(R.id.bronx));
//Brooklyn Tab
mTabHost.addTab(mTabHost.newTabSpec("").setIndicator("Brooklyn",getResources().getDrawable(R.drawable.tab_two))
.setContent(R.id.brooklyn));
//Manhattan Tab
mTabHost.addTab(mTabHost.newTabSpec("").setIndicator("Manhattan",getResources().getDrawable(R.drawable.tab_three))
.setContent(R.id.textview3));
//Queens Tab
mTabHost.addTab(mTabHost.newTabSpec("").setIndicator("Queens",getResources().getDrawable(R.drawable.tab_four))
.setContent(R.id.textview4));
//Staten Island Tab
mTabHost.addTab(mTabHost.newTabSpec("").setIndicator("Staten Island",getResources().getDrawable(R.drawable.tab_five))
.setContent(R.id.textview5));}
static final String[] BRONX = new String[] {
"Bx1 Grand Concourse","Bx2 Grand Concourse","Bx3 University Avenue/West 181 Street","Bx4","Bx4A","Bx5","Bx6","Bx7","Bx8","Bx9","Bx10","Bx11","Bx12","Bx13",
"Bx15 3 Avenue/125 Street","Bx16 East 233 Street/Nereid Avenue","Bx17","Bx18","Bx19","Bx20","Bx21","Bx22","Bx23","Bx24" ,"Bx26","Bx27"
};
static final String[] BROOKLYN = new String[] {
"Bx1 Grand Concourse"
};
}
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<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">
<ListView android:id="#+id/bronx" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_weight="1"
>
</ListView>
<ListView android:id="#+id/brooklyn" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_weight="1"
>
</ListView>
<ListView android:id="#+id/list3" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_weight="1"
>
</ListView>
<ListView android:id="#+id/list4" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_weight="1"
>
</ListView>
<TextView
android:id="#+id/textview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="" />
<TextView
android:id="#+id/textview2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="" />
<TextView
android:id="#+id/textview3"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="" />
<TextView
android:id="#+id/textview4"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="" />
<TextView
android:id="#+id/textview5"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="" />
</FrameLayout>
</LinearLayout>
</TabHost>
Each tab should have its own activity. Please see this tutorial. In each activity you will define its corresponding view separately, so you would have separate list views.