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 7768829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:01:01+00:00 2026-06-01T16:01:01+00:00

I have created following thing in android using android compatibility support package Basically i

  • 0

I have created following thing in android using android compatibility support package

enter image description here

Basically i have a FragmentAcitivity which shows two Tabs. One Tab represents Fragment #1 and second is Fragment #2. Fragment #2 has two ListFragment i.e. ListFragment #1 and ListFragment #2 , but the problem is m i am getting following error when i try to do that.

    android.view.InflateException: Binary XML file line #10: Error inflating class fragment
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:582)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
     at com.myexample.template.TextVoiceFragment.onCreateView(TextVoiceFragment.java:19)
     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:837)
     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1041)
     at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:616)
     at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1359)
     at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:422)
     at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:86)
     at android.support.v4.view.ViewPager.populate(ViewPager.java:453)
     at android.support.v4.view.ViewPager.onAttachedToWindow(ViewPager.java:563)
     at android.view.View.dispatchAttachedToWindow(View.java:6015)
     at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:1124)
     at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:1129)
     at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:1129)
     at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:1129)
     at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:1129)
     at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:1129)
     at android.view.ViewRoot.performTraversals(ViewRoot.java:731)
     at android.view.ViewRoot.handleMessage(ViewRoot.java:1744)
     at android.os.Handler.dispatchMessage(Handler.java:99)
     at android.os.Looper.loop(Looper.java:143)
     at android.app.ActivityThread.main(ActivityThread.java:4914)
     at java.lang.reflect.Method.invokeNative(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:521)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
     at dalvik.system.NativeStart.main(Native Method)
 Caused by: java.lang.IllegalStateException: Content view not yet created
     at android.support.v4.app.ListFragment.ensureList(ListFragment.java:328)
     at android.support.v4.app.ListFragment.getListView(ListFragment.java:222)
     at com.myexample.template.VoiceTemplate.onActivityCreated(VoiceTemplate.java:82)
     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:858)
     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1020)
     at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1099)
     at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:263)
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:558)

Binary XML

<fragment class="com.myexample.template.VoiceTemplate" 
    android:id="@+id/voiceListFragment"
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_weight="1" 
/>

Line number 19 contains inside onCreateView of TextVoiceFragment.class which is Fragment #2 in this case

 return inflater.inflate(R.layout.text_voice_fragment, container, false);

Line number 82 contains in code inside onActivityCreated of VoiceTemplate.class which extents ListFragment & a ListFragment #2

// 
getListView().setOnItemClickListener( new OnItemClickListener(){

    @Override
    public void onItemClick(AdapterView<?> adapterView, View view,
            int position, long arg3) {
        // TODO Auto-generated method stub
    }

 });

i have tried replacing Fragment #2 with FragmentActivity as follows

enter image description here

but in that case i am getting following error

 java.lang.ClassCastException: com.myexample.template.TextVoiceFragment 

here TextVoiceFragment is Tab second

  • 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-01T16:01:03+00:00Added an answer on June 1, 2026 at 4:01 pm

    I’m not sure that this is creating your problem, but in the future you might have others because nested fragments are not supported.

    You can read this answer of a Android Framework Engineer about that: Android: Can you nest Fragments?

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

Sidebar

Related Questions

I have a created a following renderer which renders the JTree with checkboxes and
I have created a certificate using the following SSL command: makecert -r -pe -n
I have created following rule in the .htaccess file located at the root of
I have created the following stored procedure.. CREATE PROCEDURE [dbo].[UDSPRBHPRIMBUSTYPESTARTUP] ( @CODE CHAR(5) ,
I have created the following C library for reading an image: typedef struct {
I have created the following project structure for my new asp.net mvc project any
I have created the following vsct file xml. <?xml version=1.0 encoding=utf-8?> <CommandTable xmlns=http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable xmlns:xs=http://www.w3.org/2001/XMLSchema>
Hey Guys, i have created the following Menu Structure: <div id=menu> <ul> <li><a href=#>Main
I have an ExpenseType object that I have created with the following migration: class
I have created a static library following this link . But I am facing

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.