TabHost in 1.5 problem

by EvgenyV » Wed, 29 Apr 2009 02:03:05 GMT


Sponsored Links
 i!

I have the problem since updated to 1.5. Some activity can be started
as independent activity.
In addition it can be hosted in TabHost.
tabHost.addTab(tabHost.newTabSpec("tabSettings")
.setIndicator(res.getString
(R.string.tab_settings_title),
res.getDrawable(R.drawable.settings_tab_40))
.setContent(new Intent(this, ViewSettings.class)));

When ViewSettings is starting as separate activity from some
CurrentActivity everything is OK.
Intent i = new IntentCurrentActivity ,
ConverterViewSettings.class);
CurrentActivity.startActivity(i);

But when the ViewSettings activity is starting on tab activation I got
StackOverflow exception.
The same code was OK in 1.1

There are stack trace:
04-28 17:30:26.954: ERROR/AndroidRuntime(12851): Uncaught handler:
thread main exiting due to uncaught exception
04-28 17:30:27.014: ERROR/AndroidRuntime(12851):
java.lang.StackOverflowError
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
java.util.concurrent.locks.ReentrantLock$NonfairSync.lock
(ReentrantLock.java:177)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:252)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
java.util.concurrent.CopyOnWriteArrayList.remove
(CopyOnWriteArrayList.java:384)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.view.ViewTreeObserver.removeOnPreDrawListener
(ViewTreeObserver.java:377)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.widget.TextView.onDraw(TextView.java:3745)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.view.View.draw(View.java:5838)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.view.ViewGroup.drawChild(ViewGroup.java:1486)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.view.ViewGroup.drawChild(ViewGroup.java:1484)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.view.View.draw(View.java:5841)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.view.ViewGroup.drawChild(ViewGroup.java:1486)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.view.View.draw(View.java:5841)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.view.ViewGroup.drawChild(ViewGroup.java:1486)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.view.View.draw(View.java:5841)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.view.ViewGroup.drawChild(ViewGroup.java:1486)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.view.View.draw(View.java:5944)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.widget.FrameLayout.draw(FrameLayout.java:352)
04-28 17:30:27.014: ERROR/AndroidRuntime(12851): at
android.view.ViewG



Other Threads

1. About Android and Java?

I am new to Android, and I heard that Android does not cover J2ME, so
that the adoption of Android can avoid the Sun JVM authorization.
Although android replaces traditional JVM with dalvik VM, it still
uses Java language. Does this imply that vendors can use Java language
without payment if they don't use JVM?

I am also curious about in what situations a vendor needs to pay for
using Java technology.


Thanks,
tomy

-- 

2. getting the SDK samples (a tale of woe and intrigue and two questions)

Using Eclipse, I thoroughly messed up the creation of my SDK sample
projects (e.g., ApiDemos) ... as I was paying too much attention to
the Butler vs Duke game and not enough attention to the project
creation options I was selecting.  The result was 100+ levels of
ApiDemos subdirectories that apparently I had asked Eclipse to create
in my PC's android-sdk-windows/samples/android-7/ directory.  After
overcoming a slew of 'file name too long' problems reported by Vista's
file manager, I finally removed the cancer-like directory structure
and am now trying to get a fresh copy of the SDK samples.

I moved my messed up samples directory out of the android-sdk-windows
directory and I used the 'Android SDK and AVD Manager' within Eclipse
to re-download the 'SDK Platform Android 2.1 API 7, revision 1'
package.  Although the download status messages seemed okay (e.g.,
downloading samples..., installing samples..., installed samples,
Done. 1 package installed.), it appears that the final unzip did not
execute: a new 'android-sdk-windows/samples' directory was created but
it contains only a '/android-7/ApiDemos/.metadata' directory and all
the sample code is still in a 'android-sdk-windows/temp/
samples-2.1_r01-linux.zip/samples-2.1_r01-linux' directory.  In my
previous download of the SDK samples, I didn't have to manually unzip
the sample directory.

Is 'samples-2.1_r01-linux' the correct directory for the SDK installed
on a Windows system?  How can I fix the 'Android SDK and AVD Manager'
within Eclipse so that it unzips packages after downloading them ...
as it previously has done.

-- 

3. Can't arrange radio-buttons in a Radio group.

4. Set progress bar drawable

5. How can I find out if I read the GPS signal

6. Tiled bitmap gets distorted?

7. sending lists from a server to client (android)