Thanks Mark, that was helpful.
On Aug 18, 8:49 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> Eurig Jones wrote:
> > I managed to get around this problem, but I think this might be a bug.
>
> > to refresh the text within the tab, I had to fetch the TextView widget
> > for the actual tab, and invalidate that...
>
> > RelativeLayout vg = (RelativeLayout)getTabWidget().getChildAt(0);
> > if (vg != null)
> > {
> > TextView v = (TextView) vg.getChildAt(1);
>
> > if (v != null)
> > {
> > v.setText(str);
> > v.invalidate();
> > }
> > }
>
> > This worked. BUT I shouldn't have to fetch this TextView should I?
>
> With the current implementation of tabs, yes, you need to fetch it. This
> does mean that your application may break in future editions of Android.
>
> If you are going to stick with this, I would suggest replacing
> RelativeLayout with ViewGroup in your above code snippet -- you are not
> using the RelativeLayout capabilities, and using ViewGroup isolates you
> from one set of possible changes that might break your app.
>
> > I
> > should be able to invalidate and refresh my tags at a higher level? Is
> > this a bug or am I missing something?
>
> You are thinking the built-in Android tab widgets are designed for
> developers to change their state at runtime. TabSpec is just a spec,
> used one time to create the tabs. After that, there is no public API to
> change anything about the tabs (text, icon, etc.).
>
> This is not so much a "bug" as it is a set of widgets with a modest goal
> and implementation.
>
> --
> Mark Murphy (a Commons
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, $35/Year
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---