TextView Center Gravity Crash - android

Hi I set a background to a textview as
mImageAppInstallStatus.setBackgroundResource(R.drawable.downloaded);
Then i set the gravity of textview as center as below
<TextView
android:id="#+id/textview_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12dp"
android:textColor="#ffffff"
android:gravity="center"
android:layout_alignParentLeft="true"/>
But in devices < API 11 i get a stackoverflowerror as below ..I GET THE CRASH ONLY IF I MAKE gravity center if i make gravity left it works
java.lang.StackOverflowError
04-10 13:09:33.747: E/(6732): at android.text.Layout.measureText(Layout.java:1655)
04-10 13:09:33.747: E/(6732): at android.text.Layout.getLineMax(Layout.java:689)
04-10 13:09:33.747: E/(6732): at android.text.Layout.draw(Layout.java:340)
04-10 13:09:33.747: E/(6732): at android.text.BoringLayout.draw(BoringLayout.java:365)
04-10 13:09:33.747: E/(6732): at android.widget.TextView.onDraw(TextView.java:4322)
04-10 13:09:33.747: E/(6732): at android.view.View.draw(View.java:6920)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1651)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.View.draw(View.java:6923)
04-10 13:09:33.747: E/(6732): at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1651)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.View.draw(View.java:6923)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1651)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.widget.AbsListView.dispatchDraw(AbsListView.java:1487)
04-10 13:09:33.747: E/(6732): at android.view.View.draw(View.java:7026)
04-10 13:09:33.747: E/(6732): at android.widget.AbsListView.draw(AbsListView.java:2595)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1651)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.View.draw(View.java:6923)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1651)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.View.draw(View.java:6923)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1651)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.View.draw(View.java:6923)
04-10 13:09:33.747: E/(6732): at android.support.v4.view.ViewPager.draw(ViewPager.java:2153)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1651)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.support.v4.widget.DrawerLayout.drawChild(DrawerLayout.java:769)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.View.draw(View.java:6923)
04-10 13:09:33.747: E/(6732): at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1651)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)

Your XML is probably too complicated and giving additional commands for drawing may be blocking you.
If you have too many nested layout views or if you have too many methods which have recursive calls it is normal that you will see java.lang.StackOverflowError.
Check out Android Developers blog to see how to ideally optimise your complex Layouts.
Also don't forget to check CommonsWare answer in the following topic about number of nested layouts:
Stackoverflow: Caused by nested views?

Related

My Launcher Based off androids launcher 3 ASOP doesn't open on samsung galaxy tab s

hey guys I'm working on a launcher that is based off Launcher 3 form AOSP it works perfectly on my nexus 7 tablet and all my android phones I just got the samsung galaxy tab s 8.4 and when I try to run it it crashes before it launchers heres what logcat says:
04-10 07:46:57.757: E/ActivityThread(23606): Failed to find provider info for com.android.launcher2.settings
04-10 07:46:57.897: E/AndroidRuntime(23606): FATAL EXCEPTION: main
04-10 07:46:57.897: E/AndroidRuntime(23606): Process: com.android.launcher3, PID: 23606
04-10 07:46:57.897: E/AndroidRuntime(23606): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.launcher3/com.android.launcher3.Launcher}: java.lang.RuntimeException: Binary XML file line #16: You must supply a layout_width attribute.
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2404)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2464)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.app.ActivityThread.access$900(ActivityThread.java:172)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.os.Handler.dispatchMessage(Handler.java:102)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.os.Looper.loop(Looper.java:146)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.app.ActivityThread.main(ActivityThread.java:5653)
04-10 07:46:57.897: E/AndroidRuntime(23606): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 07:46:57.897: E/AndroidRuntime(23606): at java.lang.reflect.Method.invoke(Method.java:515)
04-10 07:46:57.897: E/AndroidRuntime(23606): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
04-10 07:46:57.897: E/AndroidRuntime(23606): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
04-10 07:46:57.897: E/AndroidRuntime(23606): at dalvik.system.NativeStart.main(Native Method)
04-10 07:46:57.897: E/AndroidRuntime(23606): Caused by: java.lang.RuntimeException: Binary XML file line #16: You must supply a layout_width attribute.
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:492)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:6203)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:6372)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.widget.FrameLayout$LayoutParams.<init>(FrameLayout.java:615)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:559)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:56)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.view.LayoutInflater.inflate(LayoutInflater.java:486)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
04-10 07:46:57.897: E/AndroidRuntime(23606): at com.android.launcher3.Launcher.getQsbBar(Launcher.java:3427)
04-10 07:46:57.897: E/AndroidRuntime(23606): at com.android.launcher3.SearchDropTargetBar.setup(SearchDropTargetBar.java:72)
04-10 07:46:57.897: E/AndroidRuntime(23606): at com.android.launcher3.Launcher.setupViews(Launcher.java:1325)
04-10 07:46:57.897: E/AndroidRuntime(23606): at com.android.launcher3.Launcher.onCreate(Launcher.java:437)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.app.Activity.performCreate(Activity.java:5539)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2368)
04-10 07:46:57.897: E/AndroidRuntime(23606): ... 11 more
I know it says the error is at line 16 in the xml but what xml file theres 30 xml files so if you have any ideas please let me know
The device is a Samsung Galaxy Tab S running 4.4.2
any help would be awesome
Thanks in advance
I figured it out! the xml in question is located in: res/layout-sw720p/search_bar.xml
on line 16 you need to add the following code:
android:layout_width="match_parent"
android:layout_height="match_parent"
This fixed the crashing issue I hope this helps anyone else who is having this issue!

Getting ExceptionInInitializerError due to UnsatisfiedLinkError for Android NDK

When I use NDK + Android + JNI + OPENCV4ANDROID(2.4.2) I get the following error:
Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1312]: 2586 cannot locate '_ZN2cv3Mat8copySizeERKS0_'...
I couldn't find anything useful when I searched.
Here's the logcat:
04-10 12:05:19.960: E/AndroidRuntime(11567): FATAL EXCEPTION: main
04-10 12:05:19.960: E/AndroidRuntime(11567): java.lang.ExceptionInInitializerError
04-10 12:05:19.960: E/AndroidRuntime(11567): at java.lang.Class.newInstanceImpl>(Native Method)
04-10 12:05:19.960: E/AndroidRuntime(11567): at java.lang.Class.newInstance(Class.java:1409)
04-10 12:05:19.960: E/AndroidRuntime(11567): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
04-10 12:05:19.960: E/AndroidRuntime(11567): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)
04-10 12:05:19.960: E/AndroidRuntime(11567): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
04-10 12:05:19.960: E/AndroidRuntime(11567): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-10 12:05:19.960: E/AndroidRuntime(11567): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
04-10 12:05:19.960: E/AndroidRuntime(11567): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 12:05:19.960: E/AndroidRuntime(11567): at android.os.Looper.loop(Looper.java:130)
04-10 12:05:19.960: E/AndroidRuntime(11567): at android.app.ActivityThread.main(ActivityThread.java:3691)
04-10 12:05:19.960: E/AndroidRuntime(11567): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 12:05:19.960: E/AndroidRuntime(11567): at java.lang.reflect.Method.invoke(Method.java:507)
04-10 12:05:19.960: E/AndroidRuntime(11567): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
04-10 12:05:19.960: E/AndroidRuntime(11567): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
04-10 12:05:19.960: E/AndroidRuntime(11567): at dalvik.system.NativeStart.main(Native Method)
04-10 12:05:19.960: E/AndroidRuntime(11567): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1312]: 2586 cannot locate '_ZN2cv3Mat8copySizeERKS0_'...
04-10 12:05:19.960: E/AndroidRuntime(11567): at java.lang.Runtime.loadLibrary(Runtime.java:434)
04-10 12:05:19.960: E/AndroidRuntime(11567): at java.lang.System.loadLibrary(System.java:554)
04-10 12:05:19.960: E/AndroidRuntime(11567): at com.amani.main.chooser.<clinit>(chooser.java:139)
04-10 12:05:19.960: E/AndroidRuntime(11567): ... 15 more
Why am I getting an UnsatisfiedLinkError?

ScrollView: java.lang.StackOverflowError

I got a ScrollView with many Views and if i start the activity i got this after some scrolling:
04-10 20:11:42.480: E/AndroidRuntime(2089): FATAL EXCEPTION: main
04-10 20:11:42.480: E/AndroidRuntime(2089): java.lang.StackOverflowError
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.addFocusables(View.java:3654)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:618)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.getFocusables(View.java:3612)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.FocusFinder.findNextFocus(FocusFinder.java:109)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.FocusFinder.findNextFocus(FocusFinder.java:93)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:476)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.focusSearch(View.java:3547)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.widget.TextView.onCreateInputConnection(TextView.java:4662)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.inputmethod.InputMethodManager.startInputInner(InputMethodManager.java:945)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.inputmethod.InputMethodManager.checkFocus(InputMethodManager.java:1129)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.inputmethod.InputMethodManager.isActive(InputMethodManager.java:542)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.widget.TextView.onDraw(TextView.java:4173)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.draw(View.java:6933)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.draw(View.java:6936)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.draw(View.java:6936)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.draw(View.java:7039)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.widget.ScrollView.draw(ScrollView.java:1415)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.draw(View.java:6936)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.draw(View.java:6936)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(
Why m I getting this error any idea?
Your UI View tree is too deep. addFocusables is recursive (obviously) into the View layout tree and Android has a fairly limited stack size. Change your layout to do less nesting and more of a flat layout. You may need to write a custom layout to get the layout you want without nesting.

Android:TextToSpeech Not Working

Hi i create one application which is depend on TextToSpeech. When i am trying to run my
application It show the NullPointerException in Logcat. i search lot but didn't find helpful Answer.Here Check my Code on this link and Here is my logcat.
04-10 15:11:37.872: WARN/System.err(2798): java.lang.NullPointerException
04-10 15:11:37.872: WARN/System.err(2798): at com.example.examguide.ExamAppearingActivity.onCreate(ExamAppearingActivity.java:80)
04-10 15:11:37.872: WARN/System.err(2798): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-10 15:11:37.882: WARN/System.err(2798): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
04-10 15:11:37.882: WARN/System.err(2798): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
04-10 15:11:37.882: WARN/System.err(2798): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-10 15:11:37.882: WARN/System.err(2798): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
04-10 15:11:37.882: WARN/System.err(2798): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 15:11:37.882: WARN/System.err(2798): at android.os.Looper.loop(Looper.java:123)
04-10 15:11:37.882: WARN/System.err(2798): at android.app.ActivityThread.main(ActivityThread.java:3683)
04-10 15:11:37.882: WARN/System.err(2798): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 15:11:37.892: WARN/System.err(2798): at java.lang.reflect.Method.invoke(Method.java:507)
04-10 15:11:37.892: WARN/System.err(2798): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-10 15:11:37.892: WARN/System.err(2798): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-10 15:11:37.892: WARN/System.err(2798): at dalvik.system.NativeStart.main(Native Method)
Any help is Appreciated...
you have used this code.
final List<ObjectiveWiseQuestion> QuestionWiseProfile1= db.getOneQuestion(examId);
but you have not opened db before. So it is getting null.
ok write
tts = new TextToSpeech(this, this);
before you use tts object.
The tts object is not initialized. Hence you get a null pointer exception there.

I have an andengine program that works on one development machine but not another?

For reasons with which I won't bore you, I have to change development computers, and for the life of me I can't get my project to work on the second machine.
I have one library which is a .jar file which both machine have access to. But the program works fine on machine A but on machine B I get the errors below. At first I thought check the manifest, but, exactly the same project works fine on Machine A. So it must be something wrong with my development environment on B. Right? I can't think what it might be. I've got more apis on B than A.
04-10 20:21:50.826: W/dalvikvm(1487): Unable to resolve superclass of Lcom/webs/thefineanimationemporium/BoxingTmcthreeActivity; (117)
04-10 20:21:50.826: W/dalvikvm(1487): Link of class 'Lcom/webs/thefineanimationemporium/BoxingTmcthreeActivity;' failed
04-10 20:21:50.826: D/AndroidRuntime(1487): Shutting down VM
04-10 20:21:50.826: W/dalvikvm(1487): threadid=1: thread exiting with uncaught exception (group=0x2aac8578)
04-10 20:21:50.856: E/AndroidRuntime(1487): FATAL EXCEPTION: main
04-10 20:21:50.856: E/AndroidRuntime(1487): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.webs.thefineanimationemporium/com.webs.thefineanimationemporium.BoxingTmc threeActivity}: java.lang.ClassNotFoundException: com.webs.thefineanimationemporium.BoxingTmcthreeActivity in loader dalvik.system.PathClassLoader[/data/app/com.webs.thefineanimationemporium-1.apk]
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1581)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread.access$1500(ActivityThread.java:121)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.os.Looper.loop(Looper.java:138)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread.main(ActivityThread.java:3701)
04-10 20:21:50.856: E/AndroidRuntime(1487): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 20:21:50.856: E/AndroidRuntime(1487): at java.lang.reflect.Method.invoke(Method.java:507)
04-10 20:21:50.856: E/AndroidRuntime(1487): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
04-10 20:21:50.856: E/AndroidRuntime(1487): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
04-10 20:21:50.856: E/AndroidRuntime(1487): at dalvik.system.NativeStart.main(Native Method)
04-10 20:21:50.856: E/AndroidRuntime(1487): Caused by: java.lang.ClassNotFoundException: com.webs.thefineanimationemporium.BoxingTmcthreeActivity in loader dalvik.system.PathClassLoader[/data/app/com.webs.thefineanimationemporium-1.apk]
04-10 20:21:50.856: E/AndroidRuntime(1487): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
04-10 20:21:50.856: E/AndroidRuntime(1487): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
04-10 20:21:50.856: E/AndroidRuntime(1487): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)
04-10 20:21:50.856: E/AndroidRuntime(1487): ... 11 more
04-10 20:21:55.216: I/Process(1487): Sending signal. PID: 1487 SIG: 9
Sounds like a dodgy install on the second device to me, since one of the classes being called cant be found. Have you tried reinstalling?
edit: Sorry for sounding like someone from a tech support line...

Categories

Resources