Jump to content

bug TabActivity custom, Android 1.5


Pierre87

Recommended Posts

Salut !

Je viens de rencontrer un bug asse étrange uniquement sous Android 1.5

J'essaye de custom une TabActivity

J'ai donc un layout :

   xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent">
       android:id="@android:id/tabhost"
       android:layout_width="fill_parent"
       android:layout_height="fill_parent">
           android:layout_width="fill_parent"
           android:layout_height="fill_parent"
           android:orientation="vertical">
               android:id="@android:id/tabs"
               android:layout_width="fill_parent"
               android:layout_height="wrap_content" />
               android:id="@android:id/tabcontent"
               android:layout_width="fill_parent"
               android:layout_height="fill_parent" />



rien de méchant...

dans ma TabActivity, je fais :

super.onCreate(savedInstanceState);
this.setContentView(R.layout.general);
Resources res = this.getResources();
TabHost tabHost = this.getTabHost();

suivi de l'initialisation de mes tabs, là encore, rien de spécial

et bien je me mange une erreur :

06-30 14:31:27.739: ERROR/AndroidRuntime(6163): Uncaught handler: thread main exiting due to uncaught exception
06-30 14:31:27.769: ERROR/AndroidRuntime(6163): java.lang.StackOverflowError
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.text.Styled.foreach(Styled.java:249)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.text.Styled.drawText(Styled.java:302)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.text.Layout.drawText(Layout.java:1346)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.text.Layout.draw(Layout.java:339)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.widget.TextView.onDraw(TextView.java:3934)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.View.draw(View.java:5838)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.drawChild(ViewGroup.java:1540)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.View.draw(View.java:5841)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.drawChild(ViewGroup.java:1540)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.widget.AbsListView.dispatchDraw(AbsListView.java:1326)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.widget.ListView.dispatchDraw(ListView.java:2863)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.View.draw(View.java:5944)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.widget.AbsListView.draw(AbsListView.java:2180)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.drawChild(ViewGroup.java:1540)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.View.draw(View.java:5841)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.drawChild(ViewGroup.java:1540)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.View.draw(View.java:5841)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.drawChild(ViewGroup.java:1540)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.drawChild(ViewGroup.java:1538)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.View.draw(View.java:5841)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1892)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewRoot.draw(ViewRoot.java:1237)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1045)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1504)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.os.Looper.loop(Looper.java:123)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at android.app.ActivityThread.main(ActivityThread.java:3948)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at java.lang.reflect.Method.invokeNative(Native Method)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at java.lang.reflect.Method.invoke(Method.java:521)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
06-30 14:31:27.769: ERROR/AndroidRuntime(6163):     at dalvik.system.NativeStart.main(Native Method)

ouch...

ça ne se produit QUE sur Android 1.5

j'ai aussi remarqué que ça ne plantait pas si l'Activity du 1er onglet était TRES simple

si j'ai une ListActivity, ça plante

des idées?

merci

Link to comment
Share on other sites

j'ai plus ou moins résolu le problème en n'essayant plus de custom ma TabActivity :P

mais j'ai un problème encore pire !!!

j'ai un onglet qui fait carrément planter mon application, avec exactement le même message que précédemment : StackOverflowError.

cet onglet affiche une ListActivity dont la première ligne est assez complexe (pas mal d'imbrication)

est ce que ça peut venir de là ?

quand mon application plante j'ai à l'écran :

- TabActivity

- ListActivity

- 1 ligne dont la profondeur de View est 7

c'est trop ?

Link to comment
Share on other sites

  • 1 year later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...