I'm trying to use a template with an MvxListView but I get the following error:
mvx:Warning: 21.13 using Inflate with a null parent viewGroup is discouraged - see https://github.com/MvvmCross/MvvmCross/issues/507
[0:] mvx:Warning: 21.13 using Inflate with a null parent viewGroup is discouraged - see https://github.com/MvvmCross/MvvmCross/issues/507
02-21 13:23:05.146 I/mono-stdout(30059): mvx:Warning: 21.13 using Inflate with a null parent viewGroup is discouraged - see https://github.com/MvvmCross/MvvmCross/issues/507
An unhandled exception occured.
The ListView works fine without a template, showing the ToString for each list item.
I followed the link in the error and was worried about the Android 4.4 references as I'm running on a Nexus 4 with 4.4 so I downloaded and ran the KittenView source but that worked fine.
Here is the view
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
style="#style/Layout">
<include
android:id="#+id/header"
layout="#layout/PageHeader" />
<include
android:id="#+id/footer"
layout="#layout/CancelFooter" />
<LinearLayout
style="#style/Layout"
android:layout_below="#id/header"
android:layout_above="#id/footer">
<TextView
style="#style/Text.Title"
android:text="Add New Job" />
<Mvx.MvxListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
local:MvxBind="ItemsSource JobTypes"
local:MvxItemTemplate="#layout/jobtype_item"
/>
</LinearLayout>
</RelativeLayout>
and the template
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
local:MvxBind="Text Description" />
</LinearLayout>
Any Ideas?
UPDATE
Looks like the inflate error was a red herring - I get that error as well when there is no template and no crash. Seems to be something to do with a missing layout_width.
Here is the full crash exception:
02-21 14:22:48.990 I/MonoDroid( 6664): UNHANDLED EXCEPTION: Java.Lang.RuntimeException: Exception of type 'Java.Lang.RuntimeException' was thrown.
02-21 14:22:48.990 I/MonoDroid( 6664): at Android.Runtime.JNIEnv.CallObjectMethod (intptr,intptr,Android.Runtime.JValue[]) [0x00064] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.2-branch/4b53fbd0/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:194
02-21 14:22:48.990 I/MonoDroid( 6664): at Android.Views.LayoutInflater.Inflate (int,Android.Views.ViewGroup,bool) [0x00043] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.2-branch/4b53fbd0/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Views.LayoutInflater.cs:609
02-21 14:22:48.990 I/MonoDroid( 6664): at Cirrious.MvvmCross.Binding.Droid.BindingContext.MvxAndroidBindingContext.CommonInflate (int,Android.Views.ViewGroup,Cirrious.MvvmCross.Binding.Droid.Binders.IMvxLayoutInfactorFactory,bool) <IL 0x00046, 0x00287>
02-21 14:22:48.990 I/MonoDroid( 6664): at Cirrious.MvvmCross.Binding.Droid.BindingContext.MvxAndroidBindingContext.BindingInflate (int,Android.Views.ViewGroup,bool) <IL 0x00015, 0x00107>
02-21 14:22:48.990 I/MonoDroid( 6664): at Cirrious.MvvmCross.Binding.Droid.BindingContext.MvxAndroidBindingContext.BindingInflate (int,Android.Views.ViewGroup) <IL 0x00004, 0x00063>
02-21 14:22:48.990 I/MonoDroid( 6664): at Cirrious.MvvmCross.Binding.Droid.Views.MvxListItemView..ctor (Android.Content.Context,Cirrious.MvvmCross.Binding.Droid.Views.IMvxLayoutInflater,object,int) <IL 0x0001a, 0x000cf>
02-21 14:22:48.990 I/MonoDroid( 6664): at Cirrious.MvvmCross.Binding.Droid.Views.MvxAdapter.CreateBindableView (object,int) <IL 0x00013, 0x000bb>
02-21 14:22:48.990 I/MonoDroid( 6664): at Cirrious.MvvmCross.Binding.Droid.Views.MvxAdapter.GetBindableView (Android.Views.View,object,int) <IL 0x00027, 0x0027f>
In mgmain JNI_OnLoad
02-21 14:22:48.990 I/MonoDroid( 6664): at Cirrious.MvvmCross.Binding.Droid.Views.MvxAdapter.GetView (int,Android.Views.View,Android.Views.ViewGroup,int) <IL 0x00028, 0x0015f>
02-21 14:22:48.990 I/MonoDroid( 6664): at Cirrious.MvvmCross.Binding.Droid.Views.MvxAdapter.GetView (int,Android.Views.View,Android.Views.ViewGroup) <IL 0x0001d, 0x00143>
02-21 14:22:48.990 I/MonoDroid( 6664): at Android.Widget.BaseAdapter.n_GetView_ILandroid_view_View_Landroid_view_ViewGroup_ (intptr,intptr,int,intptr,intptr) [0x0001a] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.2-branch/4b53fbd0/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Widget.BaseAdapter.cs:460
02-21 14:22:48.990 I/MonoDroid( 6664): at (wrapper dynamic-method) object.b848e0e4-b229-42ef-800c-15bdfcb46936 (intptr,intptr,int,intptr,intptr) <IL 0x00023, 0x0005f>
02-21 14:22:48.990 I/MonoDroid( 6664):
02-21 14:22:48.990 I/MonoDroid( 6664): --- End of managed exception stack trace ---
02-21 14:22:48.990 I/MonoDroid( 6664): java.lang.RuntimeException: Binary XML file line #1: You must supply a layout_width attribute.
02-21 14:22:48.990 I/MonoDroid( 6664): at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:492)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:5948)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:6117)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.widget.FrameLayout$LayoutParams.<init>(FrameLayout.java:615)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:559)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:56)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.view.LayoutInflater.inflate(LayoutInflater.java:480)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
02-21 14:22:48.990 I/MonoDroid( 6664): at cirrious.mvvmcross.binding.droid.views.MvxAdapter.n_getView(Native Method)
02-21 14:22:48.990 I/MonoDroid( 6664): at cirrious.mvvmcross.binding.droid.views.MvxAdapter.getView(MvxAdapter.java:91)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.widget.AbsListView.obtainView(AbsListView.java:2263)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.widget.ListView.makeAndAddView(ListView.java:1790)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.widget.ListView.fillDown(ListView.java:691)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.widget.ListView.fillFromTop(ListView.java:752)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.widget.ListView.layoutChildren(ListView.java:1616)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.widget.AbsListView.onLayout(AbsListView.java:2091)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.view.View.layout(View.java:14817)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.view.ViewGroup.layout(ViewGroup.java:4631)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.view.View.layout(View.java:14817)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.view.ViewGroup.layout(ViewGroup.java:4631)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1055)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.view.View.layout(View.java:14817)
02-21 14:22:48.990 I/MonoDroid( 6664): at android.view.ViewGroup.layout(ViewGroup.java:4631)
02-21 14:22:48.990 I/MonoDroid( 6664): at
02-21 14:22:49.130 W/dalvikvm( 6664): JNI WARNING: JNI function GetMethodID called with exception pending
02-21 14:22:49.130 W/dalvikvm( 6664): in Lcirrious/mvvmcross/binding/droid/views/MvxAdapter;.n_getView:(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View; (GetMethodID)
02-21 14:22:49.130 W/dalvikvm( 6664): Pending exception is:
02-21 14:22:49.130 I/dalvikvm( 6664): java.lang.RuntimeException: Binary XML file line #1: You must supply a layout_width attribute.
02-21 14:22:49.130 I/dalvikvm( 6664): (raw stack trace not found)
02-21 14:22:49.130 I/dalvikvm( 6664): "main" prio=5 tid=1 NATIVE
02-21 14:22:49.130 I/dalvikvm( 6664): | group="main" sCount=0 dsCount=0 obj=0x417b9ca8 self=0x417a83c8
02-21 14:22:49.130 I/dalvikvm( 6664): | sysTid=6664 nice=0 sched=0/0 cgrp=apps handle=1074610516
02-21 14:22:49.130 I/dalvikvm( 6664): | state=R schedstat=( 0 0 0 ) utm=337 stm=66 core=0
02-21 14:22:49.150 I/dalvikvm( 6664): #00 pc 0000132e /system/lib/libcorkscrew.so (unwind_backtrace_thread+29)
02-21 14:22:49.150 I/dalvikvm( 6664): #01 pc 00060652 /system/lib/libdvm.so (dvmDumpNativeStack(DebugOutputTarget const*, int)+33)
02-21 14:22:49.150 I/dalvikvm( 6664): #02 pc 00054640 /system/lib/libdvm.so (dvmDumpThreadEx(DebugOutputTarget const*, Thread*, bool)+395)
02-21 14:22:49.150 I/dalvikvm( 6664): #03 pc 000546ae /system/lib/libdvm.so (dvmDumpThread(Thread*, bool)+25)
02-21 14:22:49.150 I/dalvikvm( 6664): #04 pc 00038804 /system/lib/libdvm.so
02-21 14:22:49.150 I/dalvikvm( 6664): #05 pc 00040c80 /system/lib/libdvm.so
02-21 14:22:49.150 I/dalvikvm( 6664): at cirrious.mvvmcross.binding.droid.views.MvxAdapter.n_getView(Native Method)
02-21 14:22:49.150 I/dalvikvm( 6664): at cirrious.mvvmcross.binding.droid.views.MvxAdapter.getView(MvxAdapter.java:91)
02-21 14:22:49.150 I/dalvikvm( 6664): at android.widget.AbsListView.obtainView(AbsListView.java:2263)
02-21 14:22:49.150 I/dalvikvm( 6664): at android.widget.ListView.makeAndAddView(ListView.java:1790)
02-21 14:22:49.160 I/dalvikvm( 6664): at android.widget.ListView.fillDown(ListView.java:691)
02-21 14:22:49.160 I/dalvikvm( 6664): at android.widget.ListView.fillFromTop(ListView.java:752)
02-21 14:22:49.160 I/dalvikvm( 6664): at android.widget.ListView.layoutChildren(ListView.java:1616)
02-21 14:22:49.160 I/dalvikvm( 6664): at android.widget.AbsListView.onLayout(AbsListView.java:2091)
02-21 14:22:49.160 I/dalvikvm( 6664): at android.view.View.layout(View.java:14817)
02-21 14:22:49.160 I/dalvikvm( 6664): at android.view.ViewGroup.layout(ViewGroup.java:4631)
02-21 14:22:49.160 I/dalvikvm( 6664): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
02-21 14:22:49.160 I/dalvikvm( 6664): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
02-21 14:22:49.170 I/dalvikvm( 6664): at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
02-21 14:22:49.170 I/dalvikvm( 6664): at android.view.View.layout(View.java:14817)
02-21 14:22:49.170 I/dalvikvm( 6664): at android.view.ViewGroup.layout(ViewGroup.java:4631)
02-21 14:22:49.170 I/dalvikvm( 6664): at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1055)
02-21 14:22:49.170 I/dalvikvm( 6664): at android.view.View.layout(View.java:14817)
02-21 14:22:49.170 I/dalvikvm( 6664): at android.view.ViewGroup.layout(ViewGroup.java:4631)
02-21 14:22:49.170 I/dalvikvm( 6664): at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
02-21 14:22:49.170 I/dalvikvm( 6664): at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
02-21 14:22:49.170 I/dalvikvm( 6664): at android.view.View.layout(View.java:14817)
02-21 14:22:49.170 I/dalvikvm( 6664): at android.view.ViewGroup.layout(ViewGroup.java:4631)
02-21 14:22:49.180 I/dalvikvm( 6664): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
02-21 14:22:49.180 I/dalvikvm( 6664): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
02-21 14:22:49.180 I/dalvikvm( 6664): at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
02-21 14:22:49.180 I/dalvikvm( 6664): at android.view.View.layout(View.java:14817)
02-21 14:22:49.180 I/dalvikvm( 6664): at android.view.ViewGroup.layout(ViewGroup.java:4631)
02-21 14:22:49.180 I/dalvikvm( 6664): at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
02-21 14:22:49.180 I/dalvikvm( 6664): at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
02-21 14:22:49.180 I/dalvikvm( 6664): at android.view.View.layout(View.java:14817)
02-21 14:22:49.180 I/dalvikvm( 6664): at android.view.ViewGroup.layout(ViewGroup.java:4631)
02-21 14:22:49.180 I/dalvikvm( 6664): at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1987)
02-21 14:22:49.180 I/dalvikvm( 6664): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1744)
02-21 14:22:49.180 I/dalvikvm( 6664): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
02-21 14:22:49.190 I/dalvikvm( 6664): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
02-21 14:22:49.190 I/dalvikvm( 6664): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
02-21 14:22:49.190 I/dalvikvm( 6664): at android.view.Choreographer.doCallbacks(Choreographer.java:574)
02-21 14:22:49.190 I/dalvikvm( 6664): at android.view.Choreographer.doFrame(Choreographer.java:544)
02-21 14:22:49.190 I/dalvikvm( 6664): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
02-21 14:22:49.190 I/dalvikvm( 6664): at android.os.Handler.handleCallback(Handler.java:733)
02-21 14:22:49.190 I/dalvikvm( 6664): at android.os.Handler.dispatchMessage(Handler.java:95)
02-21 14:22:49.190 I/dalvikvm( 6664): at android.os.Looper.loop(Looper.java:136)
02-21 14:22:49.190 I/dalvikvm( 6664): at android.app.ActivityThread.main(ActivityThread.java:5017)
02-21 14:22:49.190 I/dalvikvm( 6664): at java.lang.reflect.Method.invokeNative(Native Method)
02-21 14:22:49.200 I/dalvikvm( 6664): at java.lang.reflect.Method.invoke(Method.java:515)
02-21 14:22:49.200 I/dalvikvm( 6664): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
02-21 14:22:49.200 I/dalvikvm( 6664): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
02-21 14:22:49.200 I/dalvikvm( 6664): at dalvik.system.NativeStart.main(Native Method)
02-21 14:22:49.200 I/dalvikvm( 6664):
02-21 14:22:49.200 E/dalvikvm( 6664): VM aborting
02-21 14:22:49.200 E/mono-rt ( 6664): Stacktrace:
02-21 14:22:49.200 E/mono-rt ( 6664):
02-21 14:22:49.200 E/mono-rt ( 6664): at <unknown> <0xffffffff>
02-21 14:22:49.200 E/mono-rt ( 6664): at (wrapper managed-to-native) object.wrapper_native_0x41551c59 (intptr,intptr,string,string) <IL 0x0004c, 0xffffffff>
02-21 14:22:49.210 E/mono-rt ( 6664): at (wrapper delegate-invoke) <Module>.invoke_intptr__this___intptr_intptr_string_string (intptr,intptr,string,string) <IL 0x00063, 0xffffffff>
02-21 14:22:49.210 E/mono-rt ( 6664): at Android.Runtime.JNIEnv.GetMethodID (intptr,string,string) [0x00042] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.2-branch/4b53fbd0/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:157
02-21 14:22:49.210 E/mono-rt ( 6664): at Java.Lang.Throwable.get_Message () [0x00014] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.2-branch/4b53fbd0/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Java.Lang.Throwable.cs:231
02-21 14:22:49.210 E/mono-rt ( 6664): at (wrapper runtime-invoke) <Module>.runtime_invoke_object__this__ (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>
02-21 14:22:49.210 E/mono-rt ( 6664): at <unknown> <0xffffffff>
02-21 14:22:49.210 E/mono-rt ( 6664): at (wrapper dynamic-method) object.b848e0e4-b229-42ef-800c-15bdfcb46936 (intptr,intptr,int,intptr,intptr) <IL 0x00041, 0x000ec>
02-21 14:22:49.210 E/mono-rt ( 6664): at (wrapper native-to-managed) object.b848e0e4-b229-42ef-800c-15bdfcb46936 (intptr,intptr,int,intptr,intptr) <IL 0x00028, 0xffffffff>
02-21 14:22:49.210 E/mono-rt ( 6664):
02-21 14:22:49.210 E/mono-rt ( 6664): =================================================================
02-21 14:22:49.210 E/mono-rt ( 6664): Got a SIGABRT while executing native code. This usually indicates
02-21 14:22:49.210 E/mono-rt ( 6664): a fatal error in the mono runtime or one of the native libraries
02-21 14:22:49.210 E/mono-rt ( 6664): used by your application.
02-21 14:22:49.210 E/mono-rt ( 6664): =================================================================
02-21 14:22:49.210 E/mono-rt ( 6664):
Related
I am facing some issue in login screen of my app, My app supports both orientation Portrait as well as landscape, in every condition it works good but when I click on Sign in button and on loading screen I change the orientation then app crashes...
I don't know where is the problem
here is error
12-22 14:29:51.559 W/Xamarin.Insights(11215): java.lang.IllegalArgumentException: View not attached to window manager
12-22 14:29:51.559 W/Xamarin.Insights(11215): at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:406)
12-22 14:29:51.559 W/Xamarin.Insights(11215): at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:308)
12-22 14:29:51.559 W/Xamarin.Insights(11215): at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:79)
12-22 14:29:51.559 W/Xamarin.Insights(11215): at android.app.Dialog.dismissDialog(Dialog.java:323)
12-22 14:29:51.559 W/Xamarin.Insights(11215): at android.app.Dialog.dismiss(Dialog.java:306)
12-22 14:29:51.559 W/Xamarin.Insights(11215): at mono.java.lang.RunnableImplementor.n_run(Native Method)
12-22 14:29:51.559 W/Xamarin.Insights(11215): at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:29)
12-22 14:29:51.559 W/Xamarin.Insights(11215): at android.os.Handler.handleCallback(Handler.java:730)
12-22 14:29:51.559 W/Xamarin.Insights(11215): at android.os.Handler.dispatchMessage(Handler.java:92)
12-22 14:29:51.559 W/Xamarin.Insights(11215): at android.os.Looper.loop(Looper.java:137)
12-22 14:29:51.559 W/Xamarin.Insights(11215): at android.app.ActivityThread.main(ActivityThread.java:5103)
12-22 14:29:51.559 W/Xamarin.Insights(11215): at java.lang.reflect.Method.invokeNative(Native Method)
12-22 14:29:51.559 W/Xamarin.Insights(11215): at java.lang.reflect.Method.invoke(Method.java:525)
12-22 14:29:51.559 W/Xamarin.Insights(11215): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
12-22 14:29:51.559 W/Xamarin.Insights(11215): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-22 14:29:51.559 W/Xamarin.Insights(11215): at dalvik.system.NativeStart.main(Native Method)
12-22 14:29:51.656 D/dalvikvm(11215): GC_CONCURRENT freed 536K, 41% free 4454K/7484K, paused 2ms+2ms, total 52ms
An unhandled exception occured.
12-22 14:29:53.584 E/mono-rt (11215): [ERROR] FATAL UNHANDLED EXCEPTION: Java.Lang.IllegalArgumentException: View not attached to window manager
12-22 14:29:53.584 E/mono-rt (11215): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/2098/3efa14c4/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
12-22 14:29:53.584 E/mono-rt (11215): at Android.Runtime.JNIEnv.CallVoidMethod (IntPtr jobject, IntPtr jmethod) [0x00062] in /Users/builder/data/lanes/2098/3efa14c4/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:554
12-22 14:29:53.584 E/mono-rt (11215): at Android.App.Dialog.Dismiss () [0x00043] in /Users/builder/data/lanes/2098/3efa14c4/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.App.Dialog.cs:572
12-22 14:29:53.584 E/mono-rt (11215): at AndroidHUD.AndHUD+<DismissCurrent>c__AnonStorey4.<>m__0 () [0x0001c] in <filename unknown>:0
12-22 14:29:53.584 E/mono-rt (11215): at AndroidHUD.AndHUD+<DismissCurrent>c__AnonStorey4.<>m__1 (System.Object state) [0x00000] in <filename unknown>:0
12-22 14:29:53.584 E/mono-rt (11215): at Android.App.SyncContext+<Send>c__AnonStorey1.<>m__0 () [0x00000] in /Users/builder/data/lanes/2098/3efa14c4/source/monodroid/src/Mono.Android/src/Android.App/SyncContext.cs:32
12-22 14:29:53.584 E/mono-rt (11215): at Java.Lang.Thread+RunnableImplementor.Run () [0x0000b] in /Users/builder/data/lanes/2098/3efa14c4/source/monodroid/src/Mono.Android/src/Java.Lang/Thread.cs:36
12-22 14:29:53.584 E/mono-rt (11215): at Java.Lang.IRunnableInvoker.n_Run (IntPtr jnienv, IntPtr native__this) [0x00009] in /Users/builder/data/lanes/2098/3efa14c4/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Java.Lang.IRunnable.cs:71
12-22 14:29:53.584 E/mono-rt (11215): at (wrapper dynamic-method) System.Object:2491c231-85ea-488a-93d6-5c9d0adcdbd9 (intptr,intptr)
12-22 14:29:53.584 E/mono-rt (11215): --- End of managed exception stack trace ---
12-22 14:29:53.584 E/mono-rt (11215): java.lang.IllegalArgumentException: View not attached to window manager
12-22 14:29:53.584 E/mono-rt (11215): at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:406)
12-22 14:29:53.584 E/mono-rt (11215): at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:308)
12-22 14:29:53.584 E/mono-rt (11215): at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:79)
12-22 14:29:53.584 E/mono-rt (11215): at android.app.Dialog.dismissDialog(Dialog.java:323)
12-22 14:29:53.584 E/mono-rt (11215): at android.app.Dialog.dismiss(Dialog.java:306)
12-22 14:29:53.584 E/mono-rt (11215): at mono.java.lang.RunnableImplementor.n_run(Native Method)
12-22 14:29:53.584 E/mono-rt (11215): at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:29)
12-22 14:29:53.584 E/mono-rt (11215): at android.os.Handler.handleCallback(Handler.java:730)
12-22 14:29:53.584 E/mono-rt (11215): at android.os.Handler.dispatchMessage(Handler.java:92)
12-22 14:29:53.584 E/mono-rt (11215): at android.os.Looper.loop(Looper.java:137)
12-22 14:29:53.584 E/mono-rt (11215): at android.app.ActivityThread.main(ActivityThread.java:5103)
12-22 14:29:53.584 E/mono-rt (11215): at java.lang.reflect.Method.invokeNative(Native Method)
12-22 14:29:53.584 E/mono-rt (11215): at java.lang.reflect.Method.invoke(Method.java:525)
12-22 14:29:53.584 E/mono-rt (11215): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
12-22 14:29:53.584 E/mono-rt (11215): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-22 14:29:53.584 E/mono-rt (11215): at dalvik.system.NativeStart.main(Native Method)
12-22 14:29:53.584 E/mono-rt (11215):
12-22 14:29:53.622 W/Mono (11215): The request to load the assembly System.Core v4.0.0.0 was remapped to v2.0.5.0
12-22 14:29:53.640 D/Mono (11215): Unloading image System.Core.dll [0x728112e8].
12-22 14:29:53.642 D/Mono (11215): Image addref System.Core[0x7435b280] -> System.Core.dll[0x6f1ab1f0]: 8
12-22 14:29:53.650 W/Mono (11215): The request to load the assembly System.Core v4.0.0.0 was remapped to v2.0.5.0
12-22 14:29:53.654 D/Mono (11215): Unloading image System.Core.dll [0x727f41e0].
12-22 14:29:53.656 D/Mono (11215): Image addref System.Core[0x7435b280] -> System.Core.dll[0x6f1ab1f0]: 9
In mgmain JNI_OnLoad
Thank you
Use these code in the your Manifest.xml file (in your activity class) then the data will not change in the both modes (landscape or portrait).
android:configChanges="orientation|keyboard|keyboardHidden|screenSize|screenLayout|uiMode
OR USE SIMPLY THESE
android:configChanges="orientation|screenSize|screenLayout"
java.lang.IllegalArgumentException: View not attached to window manager
Means your Progress dialog not dismissed completly. So you need to check whether its null or not and showing or not. Also put it with try....catch statement.
try {
if ((myDialog!= null) && myDialog.isShowing()) {
myDialog.dismiss();
}
} catch (final IllegalArgumentException e) {
// Handle or log or ignore
} catch (final Exception e) {
// Handle or log or ignore
} finally {
myDialog = null;
}
I'm using PagerSlidingTabStrip-for-Xamarin.Android
Material Pager Sliding Tab Strip for Xamarin.Android lib
I import PagerSlidingTabStrip lib to my solution (using vs2013) and added to the xml com.refractored.PagerSlidingTabStrip
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="25px"
android:minHeight="25px">
<com.refractored.PagerSlidingTabStrip
android:id="#+id/tabs"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:pstsPaddingMiddle="true"
app:pstsDividerWidth="1dp"
app:pstsDividerPadding="12dp"
app:pstsDividerColor="#50FFFFFF" />
<!--Change this to true if you want to center items-->
<android.support.v4.view.ViewPager
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
tools:context=".MainActivity" />
</LinearLayout>
But InflateException in SetContentView "com.refractored.PagerSlidingTabStrip"
05-15 14:26:59.848 D/Mono (27464): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
05-15 14:26:59.848 D/Mono (27464): Searching for '__android_log_print'.
05-15 14:26:59.848 D/Mono (27464): Probing '__android_log_print'.
05-15 14:26:59.848 D/Mono (27464): Found as '__android_log_print'.
05-15 14:26:59.863 I/MonoDroid(27464): UNHANDLED EXCEPTION:
05-15 14:26:59.878 I/MonoDroid(27464): Android.Views.InflateException: Exception of type 'Android.Views.InflateException' was thrown.
05-15 14:26:59.878 I/MonoDroid(27464): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <IL 0x00011, 0x00068>
05-15 14:26:59.878 I/MonoDroid(27464): at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (intptr,intptr,intptr,Android.Runtime.JValue[]) [0x00084] in /Users/builder/data/lanes/1353/86274adf/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:896
05-15 14:26:59.878 I/MonoDroid(27464): at Android.App.Activity.SetContentView (int) [0x00070] in /Users/builder/data/lanes/1353/86274adf/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.App.Activity.cs:4763
05-15 14:26:59.878 I/MonoDroid(27464): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/1353/86274adf/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.App.Activity.cs:2380
05-15 14:26:59.878 I/MonoDroid(27464): at (wrapper dynamic-method) object.fc7251ee-439d-41fd-9acb-83d045358433 (intptr,intptr,intptr) <IL 0x00017, 0x00043>
05-15 14:26:59.878 I/MonoDroid(27464): --- End of managed exception stack trace ---
05-15 14:26:59.878 I/MonoDroid(27464): android.view.InflateException: Binary XML file line #1: Error inflating class com.refractored.PagerSlidingTabStrip
05-15 14:26:59.878 I/MonoDroid(27464): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
05-15 14:26:59.878 I/MonoDroid(27464): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
05-15 14:26:59.878 I/MonoDroid(27464): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
05-15 14:26:59.878 I/MonoDroid(27464): at dalvik.system.Na05-15 14:26:59.878 I/MonoDroid(27464): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
05-15 14:26:59.878 I/MonoDroid(27464): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
05-15 14:26:59.878 I/MonoDroid(27464): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
05-15 14:26:59.878 I/MonoDroid(27464): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:308)
05-15 14:26:59.878 I/MonoDroid(27464): at android.app.Activity.setContentView(Activity.java:1924)
05-15 14:26:59.878 I/MonoDroid(27464): at scrollmenu.MainActivity.n_onCreate(Native Method)
05-15 14:26:59.878 I/MonoDroid(27464): at scrollmenu.MainActivity.onCreate(MainActivity.java:28)
05-15 14:26:59.878 I/MonoDroid(27464): at android.app.Activity.performCreate(Activity.java:5206)
05-15 14:26:59.878 I/MonoDroid(27464): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
05-15 14:26:59.878 I/MonoDroid(27464): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
05-15 14:26:59.878 I/MonoDroid(27464): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
05-15 14:26:59.878 I/MonoDroid(27464): at android.app.ActivityThread.access$700(ActivityThread.java:140)
05-15 14:26:59.878 I/MonoDroid(27464): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
05-15 14:26:59.878 I/MonoDroid(27464): at android.os.Handler.dispatchMessage(Handler.java:99)
05-15 14:26:59.878 I/MonoDroid(27464): at android.os.Looper.loop(Looper.java:137)
05-15 14:26:59.878 I/MonoDroid(27464): at android.app.ActivityThread.main(ActivityThread.java:4946)
05-15 14:26:59.878 I/MonoDroid(27464): at java.lang.reflect.Method.invokeNative(Native Method)
05-15 14:26:59.878 I/MonoDroid(27464): at java.lang.reflect.Method.invoke(Method.java:511)
05-15 14:26:59.878 I/MonoDroid(27464): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1036)
05-15 14:26:59.878 I/MonoDroid(27464): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:803)
05-15 14:26:59.878 I/MonoDroid(27464): at dalvik.system.NativeStart.main(Native Method)
05-15 14:26:59.878 I/MonoDroid(27464): Caused by: java.lang.reflect.InvocationTargetException
05-15 14:26:59.878 I/MonoDroid(27464): at java.lang.reflect.Constructor.constructNative(Native Method)
05-15 14:26:59.878 I/MonoDroid(27464): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
05-15 14:26:59.878 I/MonoDroid(27464): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
05-15 14:26:59.878 I/MonoDroid(27464): ... 23 more
05-15 14:26:59.878 I/MonoDroid(27464): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x7f01009c a=-1}
05-15 14:26:59.878 I/MonoDroid(27464): at android.content.res.Resources.loadDrawable(Resources.java:2001)
05-15 14:26:59.878 I/MonoDroid(27464): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
05-15 14:26:59.878 I/MonoDroid(27464): at android.view.View.<init>(View.java:3444)
05-15 14:26:59.878 I/MonoDroid(27464): at android.view.ViewGroup.<init>(ViewGroup.java:432)
05-15 14:26:59.878 I/MonoDroid(27464): at android.widget.FrameLayout.<init>(FrameLayout.java:101)
05-15 14:26:59.878 I/MonoDroid(27464): at android.widget.HorizontalScrollView.<init>(HorizontalScrollView.java:202)
05-15 14:26:59.878 I/MonoDroid(27464): at android.widget.HorizontalScrollView.<init>(HorizontalScrollView.java:198)
05-15 14:26:59.878 I/MonoDroid(27464): at com.refractored.PagerSlidingTabStrip.<init>(PagerSlidingTabStrip.java:38)
05-15 14:26:59.878 I/MonoDroid(27464): ... 26 more
An unhandled exception occured.
05-15 14:27:01.188 E/mono (27464):
05-15 14:27:01.188 E/mono (27464): Unhandled Exception:
05-15 14:27:01.188 E/mono (27464): Android.Views.InflateException: Exception of type 'Android.Views.InflateException' was thrown.
05-15 14:27:01.188 E/mono (27464): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <IL 0x00011, 0x00068>
05-15 14:27:01.188 E/mono (27464): at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (intptr,intptr,intptr,Android.Runtime.JValue[]) [0x00084] in /Users/builder/data/lanes/1353/86274adf/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:896
05-15 14:27:01.188 E/mono (27464): at Android.App.Activity.SetContentView (int) [0x00070] in /Users/builder/data/lanes/1353/86274adf/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.App.Activity.cs:4763
05-15 14:27:01.188 E/mono (27464): at ScrollMenu.MainActivity.OnCreate (Android.OS.Bundle) [0x00009] in d:\j.vso\bbalde\android\ScrollMenu\ScrollMenu\MainActivity.cs:22
05-15 14:27:01.188 E/mono (27464): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/1353/86274adf/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.App.Activity.cs:2380
05-15 14:27:01.188 E/mono (27464): at (wrapper dynamic-method) object.fc7251ee-439d-41fd-9acb-83d045358433 (intptr,intptr,intptr) <IL 0x00017, 0x00043>
05-15 14:27:01.188 E/mono (27464):
05-15 14:27:01.188 E/mono (27464): --- End of managed exception stack trace ---
05-15 14:27:01.188 E/mono (27464): android.view.InflateException: Binary XML file line #1: Error inflating class com.refractored.PagerSlidingTabStrip
05-15 14:27:01.188 E/mono (27464): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
05-15 14:27:01.188 E/mono (27464): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
05-15 14:27:01.188 E/mono (27464): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
05-15 14:27:01.188 E/mono (27464): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
05-15 14:27:01.188 E/mono (27464): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
05-15 14:27:01.188 E/mono (27464): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
05-15 14:27:01.188 E/mono (27464): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:308)
05-15 14:27:01.188 E/mono (27464): at android.app.Activity.setContentView(Activity.java:1924)
05-15 14:27:01.188 E/mono (27464): at scrollmenu.MainActivity.n_onCreate(Native Method)
05-15 14:27:01.188 E/mono (27464): at scrollmenu.MainActivity.onCreate(MainActivity.java:28)
05-15 14:27:01.188 E/mono (27464): at android.app.Activity.performCreate(Activity.java:5206)
05-15 14:27:01.188 E/mono (27464): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
The activity can call methods on the library
So it did not connect library..?
If you use MvvmCross framework you must register PagerSlidingTabStrip assembly on Setup class:
public class Setup : MvxAndroidSetup
{
protected override IList<Assembly> AndroidViewAssemblies {
get {
var assemlies = base.AndroidViewAssemblies;
assemlies.Add(typeof(ViewPager).Assembly);
assemlies.Add(typeof(PagerSlidingTabStrip).Assembly);
return assemlies;
}
}
}
I got a Error inflating class Mvx.MvxListView error when i try to inflate a layout that have only the mvxlistview. I have a parent view that contains two child view he master and detail. The master view must have only the listview as object. When I try to inflate the xml that have only the mvxlistview the application crashes with the error below. Here are the class the xml and the error.
The MasterView:
public class SpaceMasterView : LinearLayout
{
public SpaceMasterView(Context context, IAttributeSet attr ): base(context, attr)
{
var inflator = LayoutInflater.FromContext (context);
if(inflator != null){
inflator.Inflate(Resource.Layout.Dox_Space_SpaceView_Master, this);
}
}
}
The Xml File:
<Mvx.MvxListView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
local:MvxBind="ItemsSource SubFolders;ItemClick SelectFolderCommand"
local:MvxItemTemplate="#layout/dox_space_spaceview_master_listitem"
android:id="#+id/listview_spaceview_master_folders"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textSize="24dp"/>
And this is the error. Can anyone help me to understand what is going wrong here.
[MonoDroid] UNHANDLED EXCEPTION: Android.Views.InflateException: Exception of type 'Android.Views.InflateException' was thrown.
[MonoDroid] at Android.Runtime.JNIEnv.CallObjectMethod (intptr,intptr,Android.Runtime.JValue[]) [0x00064] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/0deb0164/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:194
[MonoDroid] at Android.Views.LayoutInflater.Inflate (int,Android.Views.ViewGroup) [0x00043] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/0deb0164/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Views.LayoutInflater.cs:575
[MonoDroid] at MobileDox.Android.SpaceMasterView..ctor (Android.Content.Context,Android.Util.IAttributeSet) [0x0001e] in /Users/iibrahimi/Source/DOXMobile/MobileDox.frontend/MobileDox.Android/Views/Dox/Space/SpaceMasterView.cs:30
[MonoDroid] at (wrapper dynamic-method) object.bd9a81cb-ba0e-461d-9c35-fa6fab92a43d (intptr,object[]) <IL 0x00030, 0x00093>
[MonoDroid] at Java.Interop.TypeManager.n_Activate (intptr,intptr,intptr,intptr,intptr,intptr) [0x000c2] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/0deb0164/source/monodroid/src/Mono.Android/src/Java.Interop/TypeManager.cs:156
[MonoDroid] at (wrapper dynamic-method) object.5e425f1a-486c-4e5b-a4ef-dd0938379cd0 (intptr,intptr,intptr,intptr,intptr,intptr) <IL 0x00029, 0x0007b>
[MonoDroid]
[MonoDroid] --- End of managed exception stack trace ---
[MonoDroid] android.view.InflateException: Binary XML file line #1: Error inflating class Mvx.MvxListView
[MonoDroid] at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
[MonoDroid] at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
[MonoDroid] at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
[MonoDroid] at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
[MonoDroid] at mono.android.TypeManager.n_activate(Native Method)
[MonoDroid] at mono.android.TypeManager.Activate(TypeManager.java:7)
[MonoDroid] at mobiledox.android.SpaceMasterView.<init>(SpaceMasterView.java:29)
[MonoDroid] at java.lang.reflect.Constructor.constructNative(Native Method)
[MonoDroid] at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
[MonoDroid] at android.view.LayoutInflater.createView(LayoutInflater.java:586)
[MonoDroid] at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
[MonoDroid] at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
[MonoDroid] at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
[MonoDroid] at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
[MonoDroid] at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
[MonoDroid] at mobiledox.android.views.SpaceView.n_onCreate(Native Method)
[MonoDroid] at mobiledox.android.views.SpaceView.onCreate(SpaceView.java:29)
[MonoDroid] at android.app.Activity.performCreate(Activity.java:4469)
[MonoDroid] at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052)
[MonoDroid] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1932)
[MonoDroid] at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1993)
[MonoDroid] at android.app.ActivityThread.access$600(ActivityThread.java:127)
[MonoDroid] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1159)
[MonoDroid] at android.os.Handler.dispatchMessage(Handler.java:99)
[MonoDroid] at android.os.Looper.loop(Looper.java:137)
[MonoDroid] at android.app.ActivityThread.main(ActivityThread.java:4507)
[MonoDroid] at java.lang.reflect.Method.invokeNative(Native Method)
[MonoDroid] at java.lang.reflect.Method.invoke(Method.java:511)
[MonoDroid] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:978)
[MonoDroid] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
[MonoDroid] at dalvik.system.NativeStart.main(Native Method)
[MonoDroid] Caused by: java.lang.ClassNotFoundException: Mvx.MvxListView
[MonoDroid] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
[MonoDroid] at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
[MonoDroid] at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
[MonoDroid] at android.view.LayoutInflater.createView(LayoutInflater.java:552)
[MonoDroid] at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
[MonoDroid] ... 30 more
[mono-rt] Stacktrace:
[mono-rt]
[mono-rt] at <unknown> <0xffffffff>
[mono-rt] at (wrapper managed-to-native) object.wrapper_native_0x40953d0d (intptr,intptr,intptr,intptr) <IL 0x00028, 0xffffffff>
[mono-rt] at (wrapper delegate-invoke) <Module>.invoke_intptr__this___intptr_intptr_intptr_intptr (intptr,intptr,intptr,intptr) <IL 0x00063, 0xffffffff>
[mono-rt] at Android.Runtime.JNIEnv.CallNonvirtualObjectMethod (intptr,intptr,intptr) [0x00060] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/0deb0164/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:521
[mono-rt] at Java.Lang.Object.ToString () [0x0005a] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/0deb0164/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Java.Lang.Object.cs:200
[mono-rt] at (wrapper runtime-invoke) <Module>.runtime_invoke_object__this__ (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>
[mono-rt] at <unknown> <0xffffffff>
[mono-rt] at <unknown> <0xffffffff>
[mono-rt] at (wrapper managed-to-native) System.Diagnostics.Debugger.Mono_UnhandledException_internal (System.Exception) <IL 0x00021, 0xffffffff>
[mono-rt] at System.Diagnostics.Debugger.Mono_UnhandledException (System.Exception) <IL 0x00001, 0x00043>
[mono-rt] at (wrapper dynamic-method) object.968f7a14-2e1a-4096-a88d-780b84872f1d (intptr,intptr,intptr) <IL 0x00026, 0x0005f>
[mono-rt] at (wrapper native-to-managed) object.968f7a14-2e1a-4096-a88d-780b84872f1d (intptr,intptr,intptr) <IL 0x00023, 0xffffffff>
[mono-rt]
[mono-rt] =================================================================
[mono-rt] Got a SIGSEGV while executing native code. This usually indicates
[mono-rt] a fatal error in the mono runtime or one of the native libraries
[mono-rt] used by your application.
[mono-rt] =================================================================
[mono-rt]
I think you must use MvxListView without namespace abbreviation:
<MvxListView xmlns:android="http://schemas.android.com/apk/res/android"..
I'm trying to add textview and progressbar's to a scrollview but it gives me a Java.Lang.IllegalStateException:
I'm using xamarin so this is not java but c# but it's the same principe
here's the code (summarized) :
SetContentView(Resource.Layout.Usage);
ScrollView scrollView = FindViewById<ScrollView>(Resource.Id.scrollView1);
LinearLayout linearLayout = FindViewById<LinearLayout>(Resource.Id.linearLayout2);
while (...){
TextView textView = new TextView(this);
textView.Text = "Some text";
textView.SetTextSize(Android.Util.ComplexUnitType.Sp, 18.0f);
linearLayout.AddView(textView);
ProgressBar progressBar = new ProgressBar(this, null, Android.Resource.Attribute.ProgressBarStyleHorizontal);
progressBar.Progress = 25;
linearLayout.AddView(progressBar);
}
scrollView.AddView(linearLayout);
Stack :
04-15 08:49:00.603 I/MonoDroid( 1389): UNHANDLED EXCEPTION: Java.Lang.IllegalStateException: Exception of type 'Java.Lang.IllegalStateException' was thrown.
04-15 08:49:00.603 I/MonoDroid( 1389): at Android.Runtime.JNIEnv.CallVoidMethod (intptr,intptr,Android.Runtime.JValue[]) [0x00023] in /Users/builder/data/lanes/monodroid-lion-bigsplash/0e0e51f9/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:368
04-15 08:49:00.603 I/MonoDroid( 1389): at Android.Views.ViewGroup.AddView (Android.Views.View) [0x0003e] in /Users/builder/data/lanes/monodroid-lion-bigsplash/0e0e51f9/source/monodroid/src/Mono.Android/platforms/android-8/src/generated/Android.Views.ViewGroup.cs:1186
04-15 08:49:00.603 I/MonoDroid( 1389): at MyOrangeDroid.Usage.OnCreate (Android.OS.Bundle) [0x001be] in c:\Users\clement\Documents\Visual Studio 2012\Projects\MyOrangeAndroid\MyOrangeDroid\Usage.cs:70
04-15 08:49:00.603 I/MonoDroid( 1389): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00010] in /Users/builder/data/lanes/monodroid-lion-bigsplash/0e0e51f9/source/monodroid/src/Mono.Android/platforms/android-8/src/generated/Android.App.Activity.cs:1490
04-15 08:49:00.603 I/MonoDroid( 1389): at (wrapper dynamic-method) object.6c050c56-6d80-48bc-9425-e832938cdfa7 (intptr,intptr,intptr) <IL 0x00017, 0x00043>
04-15 08:49:00.603 I/MonoDroid( 1389):
04-15 08:49:00.603 I/MonoDroid( 1389): --- End of managed exception stack trace ---
04-15 08:49:00.603 I/MonoDroid( 1389): java.lang.IllegalStateException: ScrollView can host only one direct child
04-15 08:49:00.603 I/MonoDroid( 1389): at android.widget.ScrollView.addView(ScrollView.java:211)
04-15 08:49:00.603 I/MonoDroid( 1389): at myorangedroid.Usage.n_onCreate(Native Method)
04-15 08:49:00.603 I/MonoDroid( 1389): at myorangedroid.Usage.onCreate(Usage.java:28)
04-15 08:49:00.603 I/MonoDroid( 1389): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-15 08:49:00.603 I/MonoDroid( 1389): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
04-15 08:49:00.603 I/MonoDroid( 1389): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
04-15 08:49:00.603 I/MonoDroid( 1389): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-15 08:49:00.603 I/MonoDroid( 1389): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
04-15 08:49:00.603 I/MonoDroid( 1389): at android.os.Handler.dispatchMessage(Handler.java:99)
04-15 08:49:00.603 I/MonoDroid( 1389): at android.os.Looper.loop(Looper.java:123)
04-15 08:49:00.603 I/MonoDroid( 1389): at android.app.ActivityThread.main(ActivityThread.java:3683)
04-15 08:49:00.603 I/MonoDroid( 1389): at java.lang.reflect.Method.invokeNative(Native Method)
04-15 08:49:00.603 I/MonoDroid( 1389): at java.lang.reflect.Method.invoke(Method.java:507)
04-15 08:49:00.603 I/MonoDroid( 1389): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-15 08:49:00.603 I/MonoDroid( 1389): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-15 08:49:00.603 I/MonoDroid( 1389): at dalvik.system.NativeStart.main(Native Method)
In mgmain JNI_OnLoad
04-15 08:49:01.503 W/dalvikvm( 1389): JNI WARNING: JNI method called with exception raised
04-15 08:49:01.503 W/dalvikvm( 1389): in Lmyorangedroid/Usage;.n_onCreate (Landroid/os/Bundle;)V (CallObjectMethod)
04-15 08:49:01.503 W/dalvikvm( 1389): Pending exception is:
04-15 08:49:01.503 I/dalvikvm( 1389): Ljava/lang/IllegalStateException;: ScrollView can host only one direct child
04-15 08:49:01.513 I/dalvikvm( 1389): (no stack trace data found)
04-15 08:49:01.513 I/dalvikvm( 1389): "main" prio=5 tid=1 NATIVE
04-15 08:49:01.513 I/dalvikvm( 1389): | group="main" sCount=0 dsCount=0 obj=0x4001f1a8 self=0xce48
04-15 08:49:01.513 I/dalvikvm( 1389): | sysTid=1389 nice=0 sched=0/0 cgrp=default handle=-1345006528
04-15 08:49:01.513 I/dalvikvm( 1389): | schedstat=( 7098128094 1495743800 310 )
04-15 08:49:01.513 I/dalvikvm( 1389): at myorangedroid.Usage.n_onCreate(Native Method)
04-15 08:49:01.523 I/dalvikvm( 1389): at myorangedroid.Usage.onCreate(Usage.java:28)
04-15 08:49:01.523 I/dalvikvm( 1389): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-15 08:49:01.523 I/dalvikvm( 1389): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
04-15 08:49:01.523 I/dalvikvm( 1389): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
04-15 08:49:01.523 I/dalvikvm( 1389): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-15 08:49:01.523 I/dalvikvm( 1389): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
04-15 08:49:01.523 I/dalvikvm( 1389): at android.os.Handler.dispatchMessage(Handler.java:99)
04-15 08:49:01.523 I/dalvikvm( 1389): at android.os.Looper.loop(Looper.java:123)
04-15 08:49:01.523 I/dalvikvm( 1389): at android.app.ActivityThread.main(ActivityThread.java:3683)
04-15 08:49:01.523 I/dalvikvm( 1389): at java.lang.reflect.Method.invokeNative(Native Method)
04-15 08:49:01.523 I/dalvikvm( 1389): at java.lang.reflect.Method.invoke(Method.java:507)
04-15 08:49:01.523 I/dalvikvm( 1389): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-15 08:49:01.523 I/dalvikvm( 1389): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-15 08:49:01.523 I/dalvikvm( 1389): at dalvik.system.NativeStart.main(Native Method)
04-15 08:49:01.523 I/dalvikvm( 1389):
04-15 08:49:01.523 E/dalvikvm( 1389): VM aborting
04-15 08:49:01.533 I/mono ( 1389): Stacktrace:
04-15 08:49:01.533 I/mono ( 1389):
04-15 08:49:01.533 I/mono ( 1389): at Android.Runtime.JNIEnv.CallObjectMethod (intptr,intptr) [0x00000] in /Users/builder/data/lanes/monodroid-lion-bigsplash/0e0e51f9/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:129
04-15 08:49:01.533 I/mono ( 1389): at Java.Lang.Throwable.get_Message () [0x0003e] in /Users/builder/data/lanes/monodroid-lion-bigsplash/0e0e51f9/source/monodroid/src/Mono.Android/platforms/android-8/src/generated/Java.Lang.Throwable.cs:195
04-15 08:49:01.533 I/mono ( 1389): at (wrapper runtime-invoke) <Module>.runtime_invoke_object__this__ (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>
Unhandled Exception:
Java.Lang.IllegalStateException:
Thanks for the help/read :-)
ScrollView must have only one Direct child
if you are trying to add like below
layout.AddView(textView);
layout.AddView(progressBar);
it will throw the Exception saying ScrollView must have only one direct child
Solution:
Take LinearLayout and add textView and progressbar to it and then add LinearLayout to the ScrollView
And also in your code, method names are given in Capital Letters, Remember java is Case Sensitive. I think you are just giving the above code for the overview.
Any chance you have anything inside your scrollview on your xml? If there is nothing there, try to remove all views before adding a new one. This is java but you must have an equivalent in c#.
scrollView.removeAllViews();
If you have nothing like that, remove the very first view, there will be only one anyway.
scrollView.removeView(0);
Remove all views
Trying to run this (example code from developer.android.com)
MediaExtractor extractor = new MediaExtractor();
extractor.setDataSource("/sdcard/myvideo.mp4");
Getting "Failed to instantiate extractor" exception on the second line.
Tried to place the file in internal storage, tried to access via FileDescriptor, nothing helped.
Anyone??
I/MonoDroid( 6802): UNHANDLED EXCEPTION: Java.IO.IOException: Exception of type 'Java.IO.IOException' was thrown.
I/MonoDroid( 6802): at Android.Runtime.JNIEnv.CallVoidMethod (intptr,intptr,Android.Runtime.JValue[]) [0x00023] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.4-series/c6e52015/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:368
I/MonoDroid( 6802): at Android.Media.MediaExtractor.SetDataSource (Java.IO.FileDescriptor) [0x0002d] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.4-series/c6e52015/source/monodroid/src/Mono.Android/platforms/android-16/src/generated/Android.Media.MediaExtractor.cs:206
I/MonoDroid( 6802): at AndroidApplication1.Activity1.ExtractVideo () [0x0001e] in c:\Users\pka\Documents\Visual Studio 2012\Projects\AndroidApplication1\AndroidApplication1\Activity1.cs:64
I/MonoDroid( 6802): at AndroidApplication1.Activity1.<OnCreate>b__2 (object,System.EventArgs) [0x00001] in c:\Users\pka\Documents\Visual Studio 2012\Projects\AndroidApplication1\AndroidApplication1\Activity1.cs:53
I/MonoDroid( 6802): at Android.Views.View/IOnClickListenerImplementor.OnClick (Android.Views.View) [0x0000b] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.4-series/c6e52015/source/monodroid/src/Mono.Android/platforms/android-16/src/generated/Android.Views.View.cs:1382
I/MonoDroid( 6802): at Android.Views.View/IOnClickListenerInvoker.n_OnClick_Landroid_view_View_ (intptr,intptr,intptr) [0x00010] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.4-series/c6e52015/source/monodroid/src/Mono.Android/platforms/android-16/src/generated/Android.Views.View.cs:1353
I/MonoDroid( 6802): at (wrapper dynamic-method) object.0b69082c-1c66-4fd6-89c4-1d14273d4245 (intptr,intptr,intptr) <IL 0x00017, 0x00043>
I/MonoDroid( 6802):
I/MonoDroid( 6802): --- End of managed exception stack trace ---
I/MonoDroid( 6802): java.io.IOException: Failed to instantiate extractor.
I/MonoDroid( 6802): at android.media.MediaExtractor.setDataSource(Native Method)
I/MonoDroid( 6802): at android.media.MediaExtractor.setDataSource(MediaExtractor.java:158)
I/MonoDroid( 6802): at mono.android.view.View_OnClickListenerImplementor.n_onClick(Native Method)
I/MonoDroid( 6802): at mono.android.view.View_OnClickListenerImplementor.onClick(View_OnClickListenerImplementor.java:29)
I/MonoDroid( 6802): at android.view.View.performClick(View.java:4211)
I/MonoDroid( 6802): at android.view.View$PerformClick.run(View.java:17267)
I/MonoDroid( 6802): at android.os.Handler.handleCallback(Handler.java:615)
I/MonoDroid( 6802): at android.os.Handler.dispatchMessage(Handler.java:92)
I/MonoDroid( 6802): at android.os.Looper.loop(Looper.java:137)
I/MonoDroid( 6802): at android.app.ActivityThread.main(ActivityThread.java:4898)
I/MonoDroid( 6802): at java.lang.reflect.Method.invokeNative(Native Method)
I/MonoDroid( 6802): at java.lang.reflect.Method.invoke(Method.java:511)
I/MonoDroid( 6802): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
I/MonoDroid( 6802): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
I/MonoDroid( 6802): at dalvik.system.NativeStart.main(Native Method)
W/dalvikvm( 6802): JNI WARNING: JNI method called with exception pending
W/dalvikvm( 6802): in Lmono/android/view/View_OnClickListenerImplementor;.n_onClick:(Landroid/view/View;)V (CallObjectMethod)
W/dalvikvm( 6802): Pending exception is:
I/dalvikvm( 6802): java.io.IOException: Failed to instantiate extractor.
I/dalvikvm( 6802): (raw stack trace not found)
I/dalvikvm( 6802): "main" prio=5 tid=1 NATIVE
I/dalvikvm( 6802): | group="main" sCount=0 dsCount=0 obj=0x41094508 self=0x40e6f9a0
I/dalvikvm( 6802): | sysTid=6802 nice=0 sched=0/0 cgrp=apps handle=1074282288
I/dalvikvm( 6802): | schedstat=( 1587575495 261759711 782 ) utm=108 stm=50 core=3
I/dalvikvm( 6802): #00 pc 00001260 /system/lib/libcorkscrew.so (unwind_backtrace_thread+27)
I/dalvikvm( 6802): #01 pc 0005f904 /system/lib/libdvm.so (dvmDumpNativeStack(DebugOutputTarget const*, int)+35)
I/dalvikvm( 6802): #02 pc 000537ac /system/lib/libdvm.so (dvmDumpThreadEx(DebugOutputTarget const*, Thread*, bool)+303)
I/dalvikvm( 6802): #03 pc 00053846 /system/lib/libdvm.so (dvmDumpThread(Thread*, bool)+25)
I/dalvikvm( 6802): #04 pc 00038e02 /system/lib/libdvm.so
I/dalvikvm( 6802): #05 pc 00040f60 /system/lib/libdvm.so
I/dalvikvm( 6802): at mono.android.view.View_OnClickListenerImplementor.n_onClick(Native Method)
I/dalvikvm( 6802): at mono.android.view.View_OnClickListenerImplementor.onClick(View_OnClickListenerImplementor.java:29)
I/dalvikvm( 6802): at android.view.View.performClick(View.java:4211)
I/dalvikvm( 6802): at android.view.View$PerformClick.run(View.java:17267)
I/dalvikvm( 6802): at android.os.Handler.handleCallback(Handler.java:615)
I/dalvikvm( 6802): at android.os.Handler.dispatchMessage(Handler.java:92)
I/dalvikvm( 6802): at android.os.Looper.loop(Looper.java:137)
I/dalvikvm( 6802): at android.app.ActivityThread.main(ActivityThread.java:4898)
I/dalvikvm( 6802): at java.lang.reflect.Method.invokeNative(Native Method)
I/dalvikvm( 6802): at java.lang.reflect.Method.invoke(Method.java:511)
I/dalvikvm( 6802): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
I/dalvikvm( 6802): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
I/dalvikvm( 6802): at dalvik.system.NativeStart.main(Native Method)
I/dalvikvm( 6802):
E/dalvikvm( 6802): VM aborting
I/mono ( 6802): Stacktrace:
I/mono ( 6802):
I/mono ( 6802): at Android.Runtime.JNIEnv.CallObjectMethod (intptr,intptr) [0x00000] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.4-series/c6e52015/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:129
I/mono ( 6802): at Java.Lang.Throwable.get_Message () [0x0003e] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.4-series/c6e52015/source/monodroid/src/Mono.Android/platforms/android-16/src/generated/Java.Lang.Throwable.cs:195
I/mono ( 6802): at (wrapper runtime-invoke) <Module>.runtime_invoke_object__this__ (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>
E/mono ( 6802):
E/mono ( 6802): Unhandled Exception:
E/mono ( 6802): Java.IO.IOException: Exception of type 'Java.IO.IOException' was thrown.
E/mono ( 6802): at Android.Runtime.JNIEnv.CallVoidMethod (intptr,intptr,Android.Runtime.JValue[]) [0x00023] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.4-series/c6e52015/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:368
E/mono ( 6802): at Android.Media.MediaExtractor.SetDataSource (Java.IO.FileDescriptor) [0x0002d] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.4-series/c6e52015/source/monodroid/src/Mono.Android/platforms/android-16/src/generated/Android.Media.MediaExtractor.cs:206
E/mono ( 6802): at AndroidApplication1.Activity1.ExtractVideo () [0x0001e] in c:\Users\pka\Documents\Visual Studio 2012\Projects\AndroidApplication1\AndroidApplication1\Activity1.cs:64
E/mono ( 6802): at AndroidApplication1.Activity1.<OnCreate>b__2 (object,System.EventArgs) [0x00001] in c:\Users\pka\Documents\Visual Studio 2012\Projects\AndroidApplication1\AndroidApplication1\Activity1.cs:53
E/mono ( 6802): at Android.Views.View/IOnClickListenerImplementor.OnClick (Android.Views.View)
I/mono ( 6802): [ERROR] FATAL UNHANDLED EXCEPTION: Java.IO.IOException: Exception of type 'Java.IO.IOException' was thrown.
I/mono ( 6802): at Android.Runtime.JNIEnv.CallVoidMethod (intptr,intptr,Android.Runtime.JValue[]) [0x00023] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.4-series/c6e52015/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:368
I/mono ( 6802): at Android.Media.MediaExtractor.SetDataSource (Java.IO.FileDescriptor) [0x0002d] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.4-series/c6e52015/source/monodroid/src/Mono.Android/platforms/android-16/src/generated/Android.Media.MediaExtractor.cs:206
I/mono ( 6802): at AndroidApplication1.Activity1.ExtractVideo () [0x0001e] in c:\Users\pka\Documents\Visual Studio 2012\Projects\AndroidApplication1\AndroidApplication1\Activity1.cs:64
I/mono ( 6802): at AndroidApplication1.Activity1.<OnCreate>b__2 (object,System.EventArgs) [0x00001] in c:\Users\pka\Documents\Visual Studio 2012\Projects\AndroidApplication1\AndroidApplication1\Activity1.cs:53
I/mono ( 6802): at Android.Views.View/IOnClickListenerImplementor.OnClick (Android
V/MediaPlayerService( 1901): Delete media recorder client
D/ISecCameraHardware( 1901): stopPreview E
W/ISecCameraHardware( 1901): stopPreview: warning, preview has been stopped
I/SurfaceFlinger( 1898): id=23 Removed TurfaceView idx=2 MapSz=3
D/ISecCameraHardware( 1901): cancelPicture EX
D/SecCameraHardware( 1901): release E
D/ISecCameraHardware( 1901): Camera.... release
W/InputDispatcher( 2253): channel ~ Consumer closed input channel or an error occurred. events=0x9
I am an idiot...I had another part of my program holding open the same file that the extractor was supposed to read off...
Quite bad error message from Android though.