Exception when clearing tabs and onResume() from different applications

by Miguel Paraz » Thu, 10 Dec 2009 00:33:18 GMT


Sponsored Links
 i,
In my onResume() I have this, to recreate the tabs every time i run.
This is because the tab content changes depending on the program
state.

tabHost = getTabHost();
tabHost.setCurrentTab(0);
tabHost.clearAllTabs();
tabSpec = tabHost.newTabSpec("Label");
tabSpec.setContent(new Intent(this, ContentActivity.class));
// more tabs...

This works within the same application.
But when an external application is launched, or if the phone returns
from idle, this happens. It looks like an internal loop or race
condition. Is there a better way to rebuild the TabHost? This is on
Cupcake.

12-09 18:55:47.596 E/AndroidRuntime( 1009): Caused by:
java.lang.NullPointerException
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.widget.TabWidget.onFocusChange(TabWidget.java:241)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.View.onFocusChanged(View.java:2430)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.View.handleFocusGainInternal(View.java:2258)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewGroup.handleFocusGainInternal(ViewGroup.java:398)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.View.requestFocus(View.java:3232)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewGroup.requestFocus(ViewGroup.java:1005)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:
1050)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewGroup.requestFocus(ViewGroup.java:1009)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:
1050)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewGroup.requestFocus(ViewGroup.java:1006)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:
1050)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewGroup.requestFocus(ViewGroup.java:1006)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:
1050)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewGroup.requestFocus(ViewGroup.java:1006)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.View.requestFocus(View.java:3183)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewRoot.clearChildFocus(ViewRoot.java:1378)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewGroup.clearChildFocus(ViewGroup.java:501)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewGroup.clearChildFocus(ViewGroup.java:501)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewGroup.clearChildFocus(ViewGroup.java:501)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewGroup.clearChildFocus(ViewGroup.java:501)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewGroup.clearChildFocus(ViewGroup.java:501)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewGroup.removeAllViewsInLayout(ViewGroup.java:2204)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.view.ViewGroup.removeAllViews(ViewGroup.java:2150)
12-09 18:55:47.596 E/AndroidRuntime( 1009): at
android.widget.TabHost.clearAllTabs(TabHost.java:214)
12-09 18:55:47.596 E/AndroidRuntime



Other Threads

1. Does 2.6.32 support G43(GMA X4500) chipset ?

Hi, list

I am now working with Android-x86 project.
I tested android-x86 iso image on general x86 systems. Among them, one
which has G43 as its chipset fails to bootup all the wat upto the
graphics UI. Console was able to use.

I used android-x86 donut with kernel 2.6.29 and 2.6.32.

I guessed 2.6.32 would support G43, because I've heard that intel
pushed kms for the latest chipsets into 2.6.31. But it didn't work.

Can I get some information about the status of i915 in linux kernel?
which version of i915 is in which kernel version ... and so on..

Thank you very much.

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: 

2. Why first call to Cursor.getCount() is so slow?

Hi,

I've noticed quite a strange thing with Cursor object.
If I use my own database (with SQLiteDatabase and SQLiteOpenHelper)
and run some query on it (using any of SQLiteDatabase query() methods)
this query is finished very quickly, in a few milliseconds. But then
first call to some of Cursor methods (like getCount(), moveToFirst(),
etc) takes 1000+ milliseconds!
On the other hand if I query some ContentProvider (using getContext
().getContentResolver().query()) then this query takes about 100
milliseconds to finish, which is understood. But then first call (and
subsequent calls) to any of Cursor methods described above is very
fast.

My question is:
Why first call to say Cursor getContent() is so long in case I use my
database in contrast to using ContentProvider's?

Am I missing something? :)

Thanks in advance

-- 

3. Delivered: . Wts : android G1 (htc dream)

4. Delivered: WTA : Performa XL Unlimited di Android

5. Creating databases

6. Touch screen inactive

7. C programming