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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:50:28+00:00 2026-06-10T11:50:28+00:00

I’m trying to preview a ListFragment in the Graphical Layout Editor. As it has

  • 0

I’m trying to preview a ListFragment in the Graphical Layout Editor. As it has no fragment layout to preview, I simply created an xml with a ListView inside, just to see how the items look, and set Preview List Content with one of the default item layouts, just to try.

The problems are:

  1. The list in the preview is empty, no matter what Preview List Content I choose; (I don’t know what I was doing wrong, now it works)
  2. I want to preview my own custom list item View, not just a layout, because I’ll be doing few things when isInEditMode() is true.

Any idea?

EDIT: The fragment is a ListFragment, but I can live with using a “temporary” listview.xml layout. What I want is a way to see a listview with my CustomListItemView inside. In the fragment, I’ll place them there with a custom adapter; in the layout editor I wish I could choose CustomListItemView from Preview List Content menu.

I can’t just use the custom item’s layout as Preview List Content, because its root is a <merge> (my custom item extends RelativeLayout). This could be solved by changing for a moment <merge> into <RelativeLayout>. However, this custom item view changes depending on data, so I’d love to see a preview of the various states, by using the isInEditMode() facility.

The best would be if it all could work without the temporary listview.xml layout, but this is becoming a feature request.

Right now I’m resorting to use a vertical LinearLayout.

  • 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-10T11:50:30+00:00Added an answer on June 10, 2026 at 11:50 am

    I took a look, and it looks like the answer is that this isn’t possible today, because of two bugs.

    1. For some reason, ListView preview doesn’t work if the ListView is the root element of the layout, rather than being embedded within the layout. The workaround for this is simple; just surround the ListView with some other layout such as a LinearLayout, setting you ListView’s layout_width and layout_height to match_parent.

    2. For some reason, when a layout with a ListView along with a custom view is included into another layout, the custom list item layout isn’t working. I know this used to work, so it must have broken at some point, probably when we switched from using comment-style metadata to the tools-namespace metadata to record which layout to use.

    I’ve filed this issue to track the work:
    http://code.google.com/p/android/issues/detail?id=36838

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
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
I am trying to understand how to use SyndicationItem to display feed which is
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 have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

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.