Forum Xamarin.Android

Problem with Android 4.4.2

Hello

My App was working fine. but in a Samsung Galaxy S4 after update to android 4.4.2 App crash when I try to open one screen, other screen application works fine.
I have not instaled xamarind 4.12 because I´m having problems with it.
any idea what could be the problem?

thanks

Posts

  • FlixGonzelzFlixGonzelz ESMember

    I have the problema is
    a call to adapter.NotifyDataSetChanged()
    On prior Android versión Works fine but in 4.4.2 App crash
    How can I solve it?

  • JamesMontemagnoJamesMontemagno USForum Administrator, Xamarin Team, Developer Group Leader Xamurai

    Are you running adapter.NotifyDataSetChanged() on the ui thread?

    RunOnUiThread (() => {
    adapter.NotifyDataSetChanged()
    });

    What is the error that you are seeing in the logs?

  • FlixGonzelzFlixGonzelz ESMember

    thanks,
    this it´s the log:

    04-30 11:01:58.978 D/AbsListView(30000): onVisibilityChanged() is called, visibility : 4 04-30 11:01:58.978 D/AbsListView(30000): unregisterIRListener() is called 04-30 11:01:58.988 D/AbsListView(30000): onVisibilityChanged() is called, visibility : 0 04-30 11:01:58.988 D/AbsListView(30000): unregisterIRListener() is called 04-30 11:01:59.008 D/AbsListView(30000): unregisterIRListener() is called 04-30 11:01:59.068 D/AndroidRuntime(30000): Shutting down VM 04-30 11:01:59.068 W/dalvikvm(30000): threadid=1: thread exiting with uncaught exception (group=0x418dfda0) 04-30 11:01:59.068 E/AndroidRuntime(30000): FATAL EXCEPTION: main 04-30 11:01:59.068 E/AndroidRuntime(30000): Process: inasa.Advanced.Droid, PID: 30000 04-30 11:01:59.068 E/AndroidRuntime(30000): java.lang.NullPointerException 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.TextView.makeNewLayout(TextView.java:7462) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.TextView.onMeasure(TextView.java:7789) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.View.measure(View.java:17387) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.Spinner.setUpChild(Spinner.java:646) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.Spinner.makeView(Spinner.java:609) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.Spinner.getBaseline(Spinner.java:442) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.RelativeLayout.getRelatedViewBaseline(RelativeLayout.java:1023) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.RelativeLayout.alignBaseline(RelativeLayout.java:642) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:519) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.View.measure(View.java:17387) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5352) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.View.measure(View.java:17387) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5352) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1410) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.LinearLayout.measureVertical(LinearLayout.java:695) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.View.measure(View.java:17387) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5352) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.View.measure(View.java:17387) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:719) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:455) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.View.measure(View.java:17387) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5352) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.View.measure(View.java:17387) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.LinearLayout.measureVertical(LinearLayout.java:847) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.View.measure(View.java:17387) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5352) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) 04-30 11:01:59.068 E/AndroidRuntime(30000): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2533) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.View.measure(View.java:17387) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2212) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1351) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1548) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1235) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6470) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.Choreographer.doCallbacks(Choreographer.java:603) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.Choreographer.doFrame(Choreographer.java:573) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.os.Handler.handleCallback(Handler.java:733) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.os.Handler.dispatchMessage(Handler.java:95) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.os.Looper.loop(Looper.java:157) 04-30 11:01:59.068 E/AndroidRuntime(30000): at android.app.ActivityThread.main(ActivityThread.java:5356) 04-30 11:01:59.068 E/AndroidRuntime(30000): at java.lang.reflect.Method.invokeNative(Native Method) 04-30 11:01:59.068 E/AndroidRuntime(30000): at java.lang.reflect.Method.invoke(Method.java:515) 04-30 11:01:59.068 E/AndroidRuntime(30000): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265) 04-30 11:01:59.068 E/AndroidRuntime(30000): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081) 04-30 11:01:59.068 E/AndroidRuntime(30000): at dalvik.system.NativeStart.main(Native Method) 04-30 11:01:59.078 W/ActivityManager( 813): Force finishing activity inasa.Advanced.Droid/inasa_advanced_droid.screens.PedidosVenta 04-30 11:01:59.098 W/ContextImpl( 813): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1479 com.android.server.am.ActivityStack.startPausingLocked:1006 com.android.server.am.ActivityStack.finishActivityLocked:3162 com.android.server.am.

  • JamesMontemagnoJamesMontemagno USForum Administrator, Xamarin Team, Developer Group Leader Xamurai

    Something is going on and you have a null exception:

    04-30 11:01:59.068 E/AndroidRuntime(30000): java.lang.NullPointerException

    Are you able to debug through your GetView in your adapter? Is there anything null happening there?

    That is where I would look.

  • FlixGonzelzFlixGonzelz ESMember

    Thanks James

    The probelm happens when I use adapter into TabActivity and OnCrete, OnStart, or OnResume I add a line like " spinFormasPago.SetSelection(2);" (and only on Android 4.4.2)
    If I execute this line on button Onclick event works fine.

    I attach an example. there are 2 Activitys one Activity and one TabActivity. Only crash on TabActivity and only on device with Android 4.4.2(Samsung S4). If I exeecute on other device with previus android versión Works fine. Before update S4 to Android 4.4.2 olso was working ok

    Olso Works if I remove "@+id/documento_textFormaPago" from Tab.xaml (I do not understand what is happening)

    could be Android 4.4.2 bug?

  • germosonnergermosonner TWMember

    Hi FlixGonzelz,
    I got the same problem.
    Do you find a way on it?

    My Phone is HTC Butterfly.
    Before 4.4.2, the App works fine.
    When I upgrade to 4.4.2 the adapter.NotifyDataSetChanged() crashed, even I call this refresh on RunOnUiThread();

    Any idea?

    Thanks,
    Germos

  • FlixGonzelzFlixGonzelz ESMember

    I solveed it remplacing:

    view = context.LayoutInflater.Inflate(Android.Resource.Layout.SimpleSpinnerItem, null);

    with

    view = context.LayoutInflater.Inflate(Android.Resource.Layout.SimpleSpinnerItem, parent, false);

    on adapter GetView

    I hope this helps you

Sign In or Register to comment.