I don't really see any problem with your code...  But I am big on using XML
layouts.  Hopefully someone else can help you out here...

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Tue, Apr 17, 2012 at 10:11 AM, momo <dun...@gmail.com> wrote:

> Here's the basics of the tabhost:
>
> public class ChooserView extends TabHost {
>
> public FrameLayout tabContent;
> public TabWidget tabs;
>
> public ChooserView(Context context) {
>
>  super(context);
>  setId(android.R.id.tabhost);
> setBackgroundResource(R.drawable.cobblestone);
>
> LinearLayout ll = new LinearLayout(context);
>  ll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
> LayoutParams.FILL_PARENT));
> ll.setOrientation(LinearLayout.VERTICAL);
>  addView(ll);
>  tabContent = new FrameLayout(context);
> tabContent.setId(android.R.id.tabcontent);
>  tabContent.setLayoutParams(new
> LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,
> LayoutParams.WRAP_CONTENT, 1f));
>  ll.addView(tabContent);
>  tabs = new TabWidget(context);
> tabs.setId(android.R.id.tabs);
>  tabs.setStripEnabled(false);
> tabs.setBackgroundDrawable(new
> GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[] {
> 0x88000000, 0x66666666 } ));
>  tabs.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
> LayoutParams.WRAP_CONTENT));
> ll.addView(tabs);
>
>
> And adding tabs with this:
>
> public void registerTab(String label, int icon, Intent target){
> Drawable drawable = getResources().getDrawable(icon);
>  TabSpec spec = newTabSpec(label)
> .setIndicator(label, drawable)
>  .setContent(target);
>         addTab(spec);
>
>
> called in the activity like so...
>
> intent = new Intent().setClass(this, SitesActivity.class);
>         tabHost.registerTab("Sites", R.drawable.ic_tab_sites, intent);
>
>
> The exact contents of the res folder is pretty long, but it definitely
> does contain all the referenced files.
>
> Again, this works fine in my device, and has worked for months on their
> device...
>
> Thanks for taking the time to help with this.
>
>>
>>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to