On Sep 4, 2012, at 3:09 PM, Stephan Steiner <[email protected]> wrote:
> As requested all the output from android device logging: 
> http://justpaste.it/1a07 . This one is from switching between tabs.

This seems relevant:

        UNHANDLED EXCEPTION: Android.Views.InflateException: Exception of type 
'Android.Views.InflateException' was thrown
        ...
         at SmartAppMobileAndroid.CallCreationFragment.OnCreateView 
(Android.Views.LayoutInflater,Android.Views.ViewGroup,Android.OS.Bundle) 
[0x00003] in D:\Personal\Documents\Visual Studio 
2010\Projects\MonoDevelopTest\MonoDevelopTest\CallCreationFragment.cs:32
        ...
        android.view.InflateException: Binary XML file line #1: Error inflating 
class fragment
         (raw stack trace not found)
        Caused by:
        java.lang.IllegalArgumentException: Binary XML file line #1: Duplicate 
id 0x7f07000b, tag null, or parent id 0xffffffff with another fragment for 
smartappmobileandroid.DialerFragment
          (raw stack trace not found)
        "main" prio=5 tid=1 NATIVE
          | group="main" sCount=0 dsCount=0 obj=0x40c61460 self=0x14014a0
          | sysTid=27950 nice=0 sched=0/0 cgrp=default handle=1074341128
          | schedstat=( 1711857129 221646239 1322 ) utm=136 stm=35 core=0
          at smartappmobileandroid.CallCreationFragment.n_onCreateView(Native 
Method)

So it's dying within CallCreationFragment.OnCreateView(), which is presumably 
your first OnCreateView() method excerpt. So we know where it's dying, but why?

Because (as we all know by now) Android's documentation is...terrible...we turn 
to Android's source:

        // 
https://github.com/android/platform_frameworks_base/blob/master/core/java/android/app/Activity.java#L4641
        // If we restored from a previous state, we may already have
        // instantiated this fragment from the state and should use
        // that instance instead of making a new one.
        ...
        } else if (fragment.mInLayout) {
            // A fragment already exists and it is not one we restored from
            // previous state.
            throw new IllegalArgumentException(attrs.getPositionDescription()
                    + ": Duplicate id 0x" + Integer.toHexString(id)
                    + ", tag " + tag + ", or parent id 0x" + 
Integer.toHexString(containerId)
                    + " with another fragment for " + fname);

which looks like a "don't load a fragment twice" check.

This raises another question: why is the fragment being created twice (it's 
apparently cached by the Activity), and what should you do to protect against 
it?

Unfortunately, I have no idea there, so hit el Google and find:

        http://stackoverflow.com/a/6847770/83444
> Nested fragments are not currently supported. Trying to put a fragment within 
> the UI of another fragment will result in undefined and likely broken 
> behavior.


It looks like this is what you're trying to do, as CallCreationFragment is 
using DialerFragment, so apparently the answer is Don't Do Thatâ„¢. Perhaps you 
should try using <include/>?

 - Jon

_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to