How to change label, size of child-tab(tabspec) (of tabhost)

by Huynh Ngoc Bang » Fri, 20 May 2011 09:34:00 GMT


Sponsored Links
 I create tabhost with 4 tabspec.

I would like to change label (setIndicator), size of tab  when tab
change from this  tab to another.
How can I do.?

Thanks!

-- 



Other Threads

1. abort outgoing call

Hi,

Suppose I want to replace a short number dialed by the user (i.e. 1234) by a
full mapped real number (408xxxx1234). So I should intercept the outgoing
call, abort it, and dial the correct real number.

Although I'm able to detect the outgoing call by a BroadcastReceiver class
my problem is that I didn't found a way to actually abort the current call,
or maybe replace the number dialed by the user.

Please any hint on how to do that?

Thanks!
Alejandro.

2. How to best maintain two different versions of the same app?



That depends on what code you are trying to reuse. I have many projects
that package as JARs for reuse -- they simply don't require access to
the R. stuff. Check my github page (http://github.com/commonsguy) and
look for the cwac- projects.

However, that's not really a practical approach for full-fledged
applications.


It is difficult to answer this, since we don't know what the difference
is between the free and not-free versions of your app.

I'm going to assume that the differences could be handled by some sort
of global free/not-free flag. By that, I mean that the same code would
make up both versions of the app, and which portions are enabled or used
would be dependent on some public static data member somewhere:

if (SomeClass.IS_PAID_APP) {
        // add more stuff to menu, etc.
}

If you can organize your app that way, then you only need one code base.
Have it set to build your app one way (free or paid, your choice) and
with the proper package in your manifest for that version of the app.
Then, add an Ant task that does the following:

1. Makes a tree copy of your project dir to a temporary location

2. Switch the copy of the manifest to the new package name via a
search-and-replace

3. Switch all import statements for your old package's edition of R to
the new package, again via search-and-replace, and again on the copy,
not your original

4. Change your IS_PAID_APP (or whatever) to the opposite value
(search-and-replace in the copy)

5. Executes an Ant build for the copy of the project

6. Copies the binaries from that build to the main project's bin/
directory under a distinct name (so it doesn't clobber your other copy
of the APK)

7. Deletes the tree copy made in step #1

As Mr. Weiss points out, Eclipse dependent projects might handle some of
this -- I'm not an Eclipse user, so I cannot say for certain.

If Java had a pre-processor, this would be somewhat simpler. However,
the basic technique that I describe above has been used for a couple of
decades now. It's clunky, but it works, and it means you only have one
set of source code to deal with.

Note that the Ant <replace> task would handle your search-and-replace
stuff nicely.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_The Busy Coder's Guide to *Advanced* Android Development_
Version 1.3 Available!

3. purchases across multiple phones

4. How to best maintain two different versions of the same app?

5. upgrade my G1 to android 2.0

6. Edit Source Lookup Path... during debugging???

7. AJ sudah ada N1?? WTA N1 dan Rooted