Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7997835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:03:46+00:00 2026-06-04T15:03:46+00:00

I follow the tutorial here Android Action Bar and in The ArtistFragment.class public class

  • 0

I follow the tutorial here Android Action Bar

and in The ArtistFragment.class

public class ArtistFragment extends Fragment {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {

        View fragView = inflater.inflate(R.layout.main_fragment, container, false);
        return fragView;
    }
}

At First I select Tab Artist it show view but, when I switch to another tab, then, switch back to Artist Tab again, It cause force close.

main_fragment.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:padding="10dp"
    android:id="@+id/frags" >

    <fragment 
        android:name="com.android.custom.FragmentLeft"
        android:id="@+id/fragment_left"
        android:layout_weight="0.25"
        android:layout_width="0dp"
        android:layout_height="match_parent"/>
    <fragment 
        android:name="com.android.custom.FragmentRight"
        android:id="@+id/fragment_right"
        android:layout_weight="0.75"
        android:layout_width="0dp"
        android:layout_height="match_parent"/>

</LinearLayout>

Logcat

05-27 11:58:36.398: E/AndroidRuntime(4216): FATAL EXCEPTION: main
05-27 11:58:36.398: E/AndroidRuntime(4216): android.view.InflateException: Binary XML file line #9: Error inflating class fragment
05-27 11:58:36.398: E/AndroidRuntime(4216):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:688)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:724)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at android.view.LayoutInflater.inflate(LayoutInflater.java:391)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at com.android.custom.ArtistFragment.onCreateView(ArtistFragment.java:20)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:776)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at android.app.FragmentManagerImpl.attachFragment(FragmentManager.java:1133)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at android.app.BackStackRecord.run(BackStackRecord.java:628)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1309)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at android.app.FragmentManagerImpl$1.run(FragmentManager.java:398)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at android.os.Handler.handleCallback(Handler.java:587)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at android.os.Handler.dispatchMessage(Handler.java:92)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at android.os.Looper.loop(Looper.java:132)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at android.app.ActivityThread.main(ActivityThread.java:4123)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at java.lang.reflect.Method.invokeNative(Native Method)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at java.lang.reflect.Method.invoke(Method.java:491)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at dalvik.system.NativeStart.main(Native Method)
05-27 11:58:36.398: E/AndroidRuntime(4216): Caused by: java.lang.IllegalArgumentException: Binary XML file line #9: Duplicate id 0x7f080011, tag null, or parent id 0x7f080010 with another fragment for com.android.custom.FragmentLeft
05-27 11:58:36.398: E/AndroidRuntime(4216):     at android.app.Activity.onCreateView(Activity.java:4182)
05-27 11:58:36.398: E/AndroidRuntime(4216):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:664)
05-27 11:58:36.398: E/AndroidRuntime(4216):     ... 18 more
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T15:03:47+00:00Added an answer on June 4, 2026 at 3:03 pm

    Why does R.layout.main_fragment have two fragments inside of it? A Fragment cannot have another Fragment inside of it…it must be inside an Activity. Is there an artist_fragment.xml that you meant to inflate instead?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to follow the facebook-android tutorial from here: https://developers.facebook.com/docs/mobile/android/build/#sample I am working in
I am trying to follow Trees tutorial at: http://cslibrary.stanford.edu/110/BinaryTrees.html Here is the code I
I'm trying to follow the Django tutorial (for v1.1) here . the problem that
I follow tutorial here on how to create web service using RESTful web service
I'm trying to follow this tutorial here but the tutorial seems to use this
I'm trying to follow the tutorial found here to implement a service layer in
I follow the tutorial here http://blog.bdoughan.com/2011/05/jaxb-and-joda-time-dates-and-times.html to use joda DateTime with jersey. But I
I'm trying to follow the grails tutorial here . When I create a new
i'm trying to follow this tutorial here http://ios-blog.co.uk/iphone-development-tutorials/parsing-json-on-ios-with-asihttprequest-and-sbjson/ to do both the ASIHttp and
Using NPOI and attempting to follow a tutorial here: http://www.zachhunter.com/2010/05/npoi-excel-template/ , I'm coming across

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.