Hello~
I recently want to put mapview in tabhost
but now is the question
i can't figure out how to do this right!
here's my source code:
TM.java
------------------------------------------------------------------------------------------
public class TM extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TabHost tabs = (TabHost) this.findViewById(R.id.my_tabhost);
tabs.setup();
TabSpec tspec1 = tabs.newTabSpec("First Tab");
tspec1.setIndicator("tab1",this.getResources().getDrawable(R.drawable.pencil));
tspec1.setContent(R.id.tab1content);
tabs.addTab(tspec1);
TabSpec tspec2 = tabs.newTabSpec("Second Tab");
tspec2.setIndicator("tab2",this.getResources().getDrawable(R.drawable.globalmap));
tspec2.setContent(R.layout.maptabview);
--------------------------------------------------------------->why i
can't put an xml in tab content?
tabs.addTab(tspec2);
TabSpec tspec3 = tabs.newTabSpec("Third Tab");
tspec3.setIndicator("Facebook",this.getResources().getDrawable(R.drawable.facebookicon));
tspec3.setContent(R.id.tab3content);
tabs.addTab(tspec3);
}
}
------------------------------------------------------------------------------------------
maptabview.xml
------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:id="@+id/maptablayout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="0O3qZmd32ga_oBxjRQislQhV085CYRGj-bBmHMQ"/>
</RelativeLayout>
------------------------------------------------------------------------------------------
please help me out !! Thank you for answering!!! :)
Hope you have a great day!
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en