When I try to create a new Typeface using this piece of code on my Product class (custom class, has getView() method to populate a ListView)
Typeface tf = Typeface.createFromAsset(context.getApplicationContext().getAssets(), "fonts/cambriab.ttf");
I get the following stacktrace:
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: native typeface cannot be made
at android.graphics.Typeface.<init>(Typeface.java:175)
at android.graphics.Typeface.createFromAsset(Typeface.java:149)
at com.darkraven.shoppinglist.Category.getView(Category.java:133)
at com.darkraven.shoppinglist.ProductListAdapter.getView(ProductListAdapter.java:40)
at android.widget.AbsListView.obtainView(AbsListView.java:2179)
at android.widget.ListView.makeAndAddView(ListView.java:1840)
at android.widget.ListView.fillDown(ListView.java:675)
at android.widget.ListView.fillFromTop(ListView.java:736)
at android.widget.ListView.layoutChildren(ListView.java:1641)
at android.widget.AbsListView.onLayout(AbsListView.java:2014)
at android.view.View.layout(View.java:14290)
at android.view.ViewGroup.layout(ViewGroup.java:4562)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1076)
at android.view.View.layout(View.java:14290)
at android.view.ViewGroup.layout(ViewGroup.java:4562)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14290)
at android.view.ViewGroup.layout(ViewGroup.java:4562)
at com.android.internal.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:349)
at android.view.View.layout(View.java:14290)
at android.view.ViewGroup.layout(ViewGroup.java:4562)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14290)
at android.view.ViewGroup.layout(ViewGroup.java:4562)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1976)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1730)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1004)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5481)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
at android.view.Choreographer.doCallbacks(Choreographer.java:562)
at android.view.Choreographer.doFrame(Choreographer.java:532)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5124)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
context is the main Activity.
If you have your ttf file placed in fonts folder in the assets , even the below code will work, or I can say it works for me ::
Typeface helveticaMedCond = Typefaces.get(getApplicationContext(), "fonts/Helvetica 67 Medium #2BD9AB.TTF");
before that cross verify whether you are using the same font name that is placed in the fonts folder or not.
Related
I get Null Pointer Exception at open ListActivity in my code but all trace is not my code.
java.lang.NullPointerException at
android.widget.AbsListView.obtainView(AbsListView.java:2606) at
android.widget.ListView.makeAndAddView(ListView.java:1840) at
android.widget.ListView.fillDown(ListView.java:681) at
android.widget.ListView.fillFromTop(ListView.java:742) at
android.widget.ListView.layoutChildren(ListView.java:1661) at
android.widget.AbsListView.onLayout(AbsListView.java:2427) at
android.view.View.layout(View.java:14938) at
android.view.ViewGroup.layout(ViewGroup.java:4601) at
android.widget.RelativeLayout.onLayout(RelativeLayout.java:1021) at
android.view.View.layout(View.java:14938) at
android.view.ViewGroup.layout(ViewGroup.java:4601) at
android.widget.FrameLayout.onLayout(FrameLayout.java:448) at
android.view.View.layout(View.java:14938) at
android.view.ViewGroup.layout(ViewGroup.java:4601) at
android.widget.FrameLayout.onLayout(FrameLayout.java:448) at
android.view.View.layout(View.java:14938) at
android.view.ViewGroup.layout(ViewGroup.java:4601) at
android.widget.LinearLayout.setChildFrame(LinearLayout.java:1694) at
android.widget.LinearLayout.layoutVertical(LinearLayout.java:1552) at
android.widget.LinearLayout.onLayout(LinearLayout.java:1465) at
android.view.View.layout(View.java:14938) at
android.view.ViewGroup.layout(ViewGroup.java:4601) at
android.widget.FrameLayout.onLayout(FrameLayout.java:448) at
android.view.View.layout(View.java:14938) at
android.view.ViewGroup.layout(ViewGroup.java:4601) at
android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2212) at
android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2026)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1236) at
android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5160)
at
android.view.Choreographer$CallbackRecord.run(Choreographer.java:791)
at android.view.Choreographer.doCallbacks(Choreographer.java:591) at
android.view.Choreographer.doFrame(Choreographer.java:561) at
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:777)
at android.os.Handler.handleCallback(Handler.java:725) at
android.os.Handler.dispatchMessage(Handler.java:92) at
android.os.Looper.loop(Looper.java:176) at
android.app.ActivityThread.main(ActivityThread.java:5365) at
java.lang.reflect.Method.invokeNative(Native Method) at
java.lang.reflect.Method.invoke(Method.java:511) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) at
dalvik.system.NativeStart.main(Native Method)
How I can know where the error occurs?
As #iagreen said, "Specifically, you are returning null from your getView method of your Adapter".
I was returning null in some case in custom adapter in getWiew.
My Application is crashing on an GT-P5110 Android 4.2.2 Samsung Tab 2 tablet. I'm currently searching all my code but can't find where it is called. I got the error output right here.
I can't find a listview which is casting this problem. I even disabled whole parts. Anyone got an idea?
java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.widget.AbsListView$LayoutParams
at android.widget.ListView.setupChild(ListView.java:1872)
at android.widget.ListView.makeAndAddView(ListView.java:1841)
at android.widget.ListView.fillDown(ListView.java:681)
at android.widget.ListView.fillFromTop(ListView.java:742)
at android.widget.ListView.layoutChildren(ListView.java:1645)
at android.widget.AbsListView.onLayout(AbsListView.java:2511)
at android.view.View.layout(View.java:14694)
at android.view.ViewGroup.layout(ViewGroup.java:4491)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1021)
at android.view.View.layout(View.java:14694)
at android.view.ViewGroup.layout(ViewGroup.java:4491)
at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:931)
at android.view.View.layout(View.java:14694)
at android.view.ViewGroup.layout(ViewGroup.java:4491)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14694)
at android.view.ViewGroup.layout(ViewGroup.java:4491)
at android.support.v7.internal.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:493)
at android.view.View.layout(View.java:14694)
at android.view.ViewGroup.layout(ViewGroup.java:4491)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14694)
at android.view.ViewGroup.layout(ViewGroup.java:4491)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1669)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1527)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
at android.view.View.layout(View.java:14694)
at android.view.ViewGroup.layout(ViewGroup.java:4491)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14694)
at android.view.ViewGroup.layout(ViewGroup.java:4491)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2200)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2014)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1227)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4995)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:791)
at android.view.Choreographer.doCallbacks(Choreographer.java:591)
at android.view.Choreographer.doFrame(Choreographer.java:561)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:777)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:175)
at android.app.ActivityThread.main(ActivityThread.java:5279)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(NativeStart.java)
I have this Exception only on some devices on android 4.1.2. So, I want to know what is the problem it can be.
Here is stack trace - no one line from my code, only from SDK - exception happens in SDK, so no lines were missed:
java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to
android.widget.LinearLayout$LayoutParams
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:996)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:576)
at android.view.View.measure(View.java:15563)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:617)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:399)
at android.view.View.measure(View.java:15563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5112)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:15563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5112)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1396)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:681)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:574)
at android.view.View.measure(View.java:15563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5112)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2423)
at android.view.View.measure(View.java:15563)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2003)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1242)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1417)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1135)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4653)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:525)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4944)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)
In your code you are importing import android.widget.LinearLayout.LayoutParams instead of android.view.ViewGroup.LayoutParams;
so Delete import android.widget.LinearLayout.LayoutParams;
and Add import android.view.ViewGroup.LayoutParams;
I'm experiencing an odd behaviour in my Android app. I have a drawable , walkthrough_safe.png and have a version in drawable-mdpi, drawable-hdpi and drawable-xhdpi folders.
I'm seeing this crash in analytics
{main} android.view.InflateException: Binary XML file line #7: Error inflating class
<unknown> at android.view.LayoutInflater.createView(LayoutInflater.java:613) at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:
56) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660) at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685) at
android.view.LayoutInflater.rInflate(LayoutInflater.java:746) at
android.view.LayoutInflater.inflate(LayoutInflater.java:489) at
android.view.LayoutInflater.inflate(LayoutInflater.java:396) at
com.a.b.activity.WalkThroughLoginActivity$WalkthroughFragment.onCreateView(WalkThroughLoginA
ctivity.java:247) at android.support.v4.app.Fragment.performCreateView(Fragment.java:1504)
at android.support.v4.app.y.a(FragmentManager.java:942) at
android.support.v4.app.y.a(FragmentManager.java:1121) at
android.support.v4.app.l.run(BackStackRecord.java:682) at
android.support.v4.app.y.d(FragmentManager.java:1484) at
android.support.v4.app.y.b(FragmentManager.java:482) at
android.support.v4.app.ad.finishUpdate(FragmentPagerAdapter.java:141) at
android.support.v4.view.ViewPager.a(ViewPager.java:1073) at
android.support.v4.view.ViewPager.b(ViewPager.java:919) at
android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1441) at
android.view.View.measure(View.java:15264) at
android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:617) at
android.widget.RelativeLayout.onMeasure(RelativeLayout.java:399) at
android.view.View.measure(View.java:15264) at
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4916) at
android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at
android.view.View.measure(View.java:15264) at
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4916) at
android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1390) at
android.widget.LinearLayout.measureVertical(LinearLayout.java:681) at
android.widget.LinearLayout.onMeasure(LinearLayout.java:574) at
android.view.View.measure(View.java:15264) at
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4916) at
android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at
android.view.View.measure(View.java:15264) at
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4916) at
android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1390) at
android.widget.LinearLayout.measureVertical(LinearLayout.java:681) at
android.widget.LinearLayout.onMeasure(LinearLayout.java:574) at
android.view.View.measure(View.java:15264) at
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4916) at
android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at
com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2339) at
android.view.View.measure(View.java:15264) at
android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2131) at
android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1242) at
android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1435) at
android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1127) at
android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4606) at
android.view.Choreographer$CallbackRecord.run(Choreographer.java:747) at
android.view.Choreographer.doCallbacks(Choreographer.java:567) at
android.view.Choreographer.doFrame(Choreographer.java:536) at
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:733) at
android.os.Handler.handleCallback(Handler.java:615) at
android.os.Handler.dispatchMessage(Handler.java:92) at
android.os.Looper.loop(Looper.java:153) at
android.app.ActivityThread.main(ActivityThread.java:5006) at
java.lang.reflect.Method.invokeNative(Native Method) at
java.lang.reflect.Method.invoke(Method.java:511) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821) at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584) at
dalvik.system.NativeStart.main(Native Method) Caused by:
java.lang.reflect.InvocationTargetException at
java.lang.reflect.Constructor.constructNative(Native Method) at
java.lang.reflect.Constructor.newInstance(Constructor.java:417) at
android.view.LayoutInflater.createView(LayoutInflater.java:587) ... 59 more Caused by:
android.content.res.Resources$NotFoundException: File res/drawable-mdpi-
v4/walkthrough_safe.png from drawable resource ID #0x7f02015c at
android.content.res.Resources.loadDrawable(Resources.java:2054) at
android.content.res.TypedArray.getDrawable(TypedArray.java:601) at android.widget.ImageView.
<init>(ImageView.java:120) at android.widget.ImageView.<init>(ImageView.java:110) ... 62
more Caused by: java.io.FileNotFoundException: res/drawable-mdpi-v4/walkthrough_safe.png at
android.content.res.AssetManager.openNonAssetNative(Native Method) at
android.content.res.AssetManager.openNonAsset(AssetManager.java:410) at
android.content.res.Resources.loadDrawable(Resources.java:2046) ... 65 more
In the line WalkThroughLoginActivity.java:247 I have this:
inflater.inflate(R.layout.fragment_login_walkthrough_2,
container, false);
And this is the layout file for fragment_login_walkthrough_2.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
style="#style/icon_walkthrough"
android:src="#drawable/walkthrough_safe" />
<TextView
style="#style/title_walkthrough"
android:layout_marginTop="#dimen/margin_walktrough_title"
android:text="#string/walkthrough2_title" />
<TextView
style="#style/text_walkthrough"
android:text="#string/walkthrough2_subtitle"/>
</LinearLayout>
Please correctly if I'm wrong but it seems to me that android is looking up for my drawable in the wrong folder (drawable-mdpi-v4), which obvioulsy does not exist. Not only that, after not finding it, it is not falling back to a more general folder, such us drawable-mdpi.
Have I missed something?
A stack trace below
Usually doesn't happen, but happens here and there to some users.
On Android 2.3.3 the exception happens on BoringLayout.isBoring:240
On Android 4.1.2 the same, line 260
Any help would be appreciated. :-)
java.lang.NullPointerException
at android.text.BoringLayout.isBoring(BoringLayout.java:260)
at android.widget.TextView.onMeasure(TextView.java:6322)
at android.view.View.measure(View.java:15473)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5056)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1396)
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1038)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:576)
at android.view.View.measure(View.java:15473)
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1223)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:576)
at android.view.View.measure(View.java:15473)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5056)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1396)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:681)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:574)
at android.view.View.measure(View.java:15473)
at android.widget.ListView.setupChild(ListView.java:1853)
at android.widget.ListView.makeAndAddView(ListView.java:1778)
at android.widget.ListView.fillDown(ListView.java:678)
at android.widget.ListView.fillFromTop(ListView.java:739)
at android.widget.ListView.layoutChildren(ListView.java:1614)
at android.widget.AbsListView.onLayout(AbsListView.java:2296)
at android.view.View.layout(View.java:14055)
at android.view.ViewGroup.layout(ViewGroup.java:4604)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:948)
at android.view.View.layout(View.java:14055)
at android.view.ViewGroup.layout(ViewGroup.java:4604)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14055)
at android.view.ViewGroup.layout(ViewGroup.java:4604)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14055)
at android.view.ViewGroup.layout(ViewGroup.java:4604)
at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1589)
at android.view.View.layout(View.java:14055)
at android.view.ViewGroup.layout(ViewGroup.java:4604)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:948)
at android.view.View.layout(View.java:14055)
at android.view.ViewGroup.layout(ViewGroup.java:4604)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14055)
at android.view.ViewGroup.layout(ViewGroup.java:4604)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1655)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1513)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1426)
at android.view.View.layout(View.java:14055)
at android.view.ViewGroup.layout(ViewGroup.java:4604)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14055)
at android.view.ViewGroup.layout(ViewGroup.java:4604)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1992)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1813)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1112)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4472)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:525)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(Native Method)
Ok found it.
I'm not deleting the question because maybe it would help someone some day.
So my mistake was:
I have extended TextView to create a class that manipulates the text, and look depending on the value set.
My error was that in some cases I chose not to set the text, and simply called 'return'. In those cases the 'text' was null, which caused the above NPE.
Lesson: If you override setText, a value MUST be set when it is called.
This is one of those points in time I remember 'design by contract', preconditions, invariants etc. This could have been helpful here.
To all those that tried to help, you have my thanks.
#Deylan - special thanks, you were the one that gave me the nudge in the right direction.