Hello!
I´m making a web browser application for Android and I´m having some
serious problems with the views. My aim is to have 3 tabs with
identical content but independant from each other (so that you can
visit three different web sites at the same time, one per tab).
Screenshot: imgur: the simple image sharer
Below the TabHost, I want it to be a small panel with a EditText
(searchfield) and a few buttons to the left and the right of the
searchfield. Below the panel I want it to be a WebView.
As it is now, I have three tabs with three independant WebViews, but I
can´t solve adding the panel above the WebView. The Panel is made in
xml and the WebView is created in java.
As you may notice in the following code I´m thinking about making my
own CustomView but I don´t really now if it´s a good idea and how to
do it properly. And then where do I put my OnClicks for the
panelbuttons?
Please help me with at least some directions!
Code:
setupTab(new WebView(this), "1");
setupTab(new WebView(this), "2");
setupTab(new WebView(this), "3");
private void setupTab(final View view, final String tag) {
View tabview = createTabView(mTabHost.getContext(), tag);
TabSpec ourSpec = mTabHost.newTabSpec(tag).setIndicator(tabview)
.setContent(new TabContentFactory() {
public View createTabContent(String tag) {
return new CustomView(ExampleActivity.this);
}
});
mTabHost.addTab(ourSpec);
}
private static View createTabView(final Context context, final String
text) {
View view = LayoutInflater.from(context)
.inflate(R.layout.tabs_bg, null);
return view;
}
--
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