You are using a CharSequence, I see that from your stack trace.

I have a similar modularity issue as you do.  Unfortunately, one of my
in-tab activity is also used standalone, so it's not most practical to
make it a View.  It's possible, but would involve some code
duplication.  Luckily, for me, removing a couple of layers combined
with the .toString() trick was enough to prevent the crash on 1.5.


On Jun 8, 3:45 pm, Thierry Legras <[email protected]> wrote:LuLu
> Thanks all for your help.
>
> Indeed, i am using Tabs with activities! I don't like the idea to switch to
> views-in-tabs design :( i found that the activities-in-tab approach allows
> to have a better modularity as my tabs are managing different data. Also tab
> content does not need to be initialized as long as the tab is not selected.
>
> I am first trying to follow your advice to pass only string in setText, and
> found only one use of CharSequence:
>
> setText(getText(aResID) + anotherString)
>
> Does toString() will help here? I admit it is not clear to me what happens
> when a String is added to a CharSequence.
>
> Anothing that might help, at some time i want to switch from one tab to
> another. So far i made a little hack: i started a new instance of my
> tabactivity on top (with target tab selected), and finish the current
> activity. I noticed the crashes often happens after that. Maybe changing
> that design will also help to reduce stackoverflow risks.
>
> Thierry.
>
> 2010/6/8 Zsolt Vasvari <[email protected]>
>
>
>
>
>
> > Are you using the tab widget by any chance?  Because adding activities
> > inside tabs will take up at least 5 layers in your UI hierarchy.  I am
> > struggling with the same issue which only crashes on 1.5, 1.6+ is
> > fine.
>
> > On Jun 7, 9:16 pm, Thierry Legras <[email protected]> wrote:
> > > Hi,
>
> > > I am facing rare StackOverflowError in my application during UI redraw.
> > Does
> > > it mean memory is exhausted? How can i fix this? And finally how can i be
> > > sure the issue will be definitevly fixed??
>
> > > Any advice would be welcome :)
> > > Thierry.
>
> > > Here is the backtrace:
>
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): java.lang.StackOverflowError
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at android.text.method.
>
> > ReplacementTransformationMethod$ReplacementCharSequence.getChars(Replacemen­­tTransformationMethod.java:151)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.text.TextUtils.getChars(TextUtils.java:69)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.text.Layout$Ellipsizer.getChars(Layout.java:1778)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.text.TextUtils.getChars(TextUtils.java:69)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.graphics.Paint.measureText(Paint.java:1016)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.text.Styled.each(Styled.java:124)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.text.Styled.foreach(Styled.java:249)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.text.Styled.measureText(Styled.java:371)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.text.Layout.measureText(Layout.java:1600)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.text.Layout.getLineMax(Layout.java:654)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.text.Layout.getLineMax(Layout.java:628)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.text.Layout.getHorizontal(Layout.java:552)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.text.Layout.getHorizontal(Layout.java:513)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.text.Layout.getPrimaryHorizontal(Layout.java:498)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.widget.TextView.getFocusedRect(TextView.java:3962)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.FocusFinder.findNextFocus(FocusFinder.java:72)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.focusSearch(ViewGroup.java:473)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.focusSearch(ViewGroup.java:475)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.focusSearch(ViewGroup.java:475)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.focusSearch(ViewGroup.java:475)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.focusSearch(ViewGroup.java:475)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.focusSearch(ViewGroup.java:475)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.View.focusSearch(View.java:3032)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.widget.TextView.onCreateInputConnection(TextView.java:4342)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
>
> > android.view.inputmethod.InputMethodManager.startInputInner(InputMethodMana­­ger.java:933)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
>
> > android.view.inputmethod.InputMethodManager.checkFocus(InputMethodManager.j­­ava:1105)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
>
> > android.view.inputmethod.InputMethodManager.isActive(InputMethodManager.jav­­a:530)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.widget.TextView.onDraw(TextView.java:3893)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.View.draw(View.java:5838)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.drawChild(ViewGroup.java:1540)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.drawChild(ViewGroup.java:1538)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.View.draw(View.java:5841)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.drawChild(ViewGroup.java:1540)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.drawChild(ViewGroup.java:1538)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.View.draw(View.java:5944)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.widget.FrameLayout.draw(FrameLayout.java:352)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.drawChild(ViewGroup.java:1540)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.View.draw(View.java:5841)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.drawChild(ViewGroup.java:1540)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.drawChild(ViewGroup.java:1538)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.drawChild(ViewGroup.java:1538)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.drawChild(ViewGroup.java:1538)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.drawChild(ViewGroup.java:1538)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.drawChild(ViewGroup.java:1538)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.drawChild(ViewGroup.java:1538)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1282)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.View.draw(View.java:5841)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.widget.FrameLayout.draw(FrameLayout.java:352)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
>
> > com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.jav­­a:1892)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewRoot.draw(ViewRoot.java:1237)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewRoot.performTraversals(ViewRoot.java:1045)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.view.ViewRoot.handleMessage(ViewRoot.java:1504)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.os.Handler.dispatchMessage(Handler.java:99)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.os.Looper.loop(Looper.java:123)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > android.app.ActivityThread.main(ActivityThread.java:3948)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at
> > > java.lang.reflect.Method.invokeNative(Native Method)
> > > 06-07 15:11:20.318 E/AndroidRuntime(22775): at java.lang.reflect.Metho
>
> > > --
> > > Thierry.
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<android-developers%2bunsubs­[email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Thierry.- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to