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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:47:45+00:00 2026-06-09T02:47:45+00:00

I’m struggling combining a tabbed ActionBar and fragments . I’m using ActionBarSherlock to display

  • 0

I’m struggling combining a tabbed ActionBar and fragments.

I’m using ActionBarSherlock to display three independent tabs, and my problem relates to the first tab exclusively. It’s supposed to display items (called “coupons”) in a combination of list and detail view. The other two tabs display different content and do not play a role here.

What I’m doing is the following:

  • The main activity creates three fragments for three tabs
  • Tab A (a list fragment) populates and renders its list
  • For clicks on the list I wrote a callback in the main activity that receives the clicked item’s id and exchanges the list fragment with the detail fragment on the tab (at least its supposed to do so)
  • In that callback I create the to-be-displayed detail fragment and try to replace the list fragment with it.

Unfortunately I dont get beyond:

java.lang.IllegalArgumentException: No view found for id 0x7f040027
for fragment CouponDetailFragment{44f4e310 #1 id=0x7f040027}

I attached the relevant snippets at the end of the question. Any help is highly appreciated.

These are the relevant snippets:

public class MyCouponActivity extends SherlockFragmentActivity implements CouponListFragment.Callbacks

List fragment:

<fragment xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:name="foo.bar.CouponListFragment"
    android:id="@+id/coupon_list"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

Transaction for fragment exchange:

@Override
public void onItemSelected(final String id) {
    final Bundle arguments = new Bundle();
    arguments.putString(CouponDetailFragment.ARG_ITEM_ID, id);
    final CouponDetailFragment fragment = new CouponDetailFragment();
    fragment.setArguments(arguments);
    getSupportFragmentManager().beginTransaction().replace(R.id.coupon_list, fragment).commit();
}
  • 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-09T02:47:48+00:00Added an answer on June 9, 2026 at 2:47 am

    If you define a fragment in XML, it is fixed and you can’t replace it with another fragment in a FragmentTransaction.

    Your best bet would be to replace the <fragment /> with some sort of ViewGroup. Don’t forget then you’d have to use a FragmentTransaction to add a CouponListFragment in the onCreate(..) of your Activity.

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.