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

The Archive Base Latest Questions

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

i have a problem using the standard android listview. if the text is to

  • 0

i have a problem using the standard android listview. if the text is to long to be displayed in one listview item i would like, that this item enlarges itself.

here is a screenshot of how it looks like now:
http://www.abload.de/image.php?img=unbenanntdjupi.png

i’m using also another listview with a custom layout, there it’s no problem: the listview-item enlarges itself.

fyi: im using actionbarsherlock so i extend my activity from ‘SherlockListActivity’.

i hope one of you can help me… because of implementing a custom listview in this case is a huge overhead :/

thanks in advance!

// edit: it’s the standard “simple_list_item_single_choice”… actually i don’t want to customize it.

<?xml version="1.0" encoding="utf-8"?>    
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@android:id/text1"
        android:layout_width="match_parent"
        android:layout_height="?android:attr/listPreferredItemHeightSmall"
        android:textAppearance="?android:attr/textAppearanceListItemSmall"
        android:gravity="center_vertical"
        android:checkMark="?android:attr/listChoiceIndicatorSingle"
        android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
        android:paddingRight="?android:attr/listPreferredItemPaddingRight"
    />

here’s the code how i added it to my layout:

    <ListView 
        android:id="@id/android:list"
        android:layout_height="0dip"
        android:layout_width="fill_parent"
        android:layout_weight="1" />

// edit after implementing iturki’s answer:
it solves the problem for android 4.x but not on devices with android level 10.

Exception:

08-30 14:25:04.049: E/AndroidRuntime(843): FATAL EXCEPTION: main
08-30 14:25:04.049: E/AndroidRuntime(843): android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.CheckedTextView
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.view.LayoutInflater.createView(LayoutInflater.java:518)
08-30 14:25:04.049: E/AndroidRuntime(843):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:332)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.AbsListView.obtainView(AbsListView.java:1430)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.ListView.makeAndAddView(ListView.java:1745)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.ListView.fillDown(ListView.java:670)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.ListView.fillFromTop(ListView.java:727)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.ListView.layoutChildren(ListView.java:1598)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.AbsListView.onLayout(AbsListView.java:1260)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.view.View.layout(View.java:7175)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.view.View.layout(View.java:7175)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.view.View.layout(View.java:7175)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.view.View.layout(View.java:7175)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.view.View.layout(View.java:7175)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.view.View.layout(View.java:7175)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.view.View.layout(View.java:7175)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.view.ViewRoot.performTraversals(ViewRoot.java:1140)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.os.Handler.dispatchMessage(Handler.java:99)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.os.Looper.loop(Looper.java:123)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.app.ActivityThread.main(ActivityThread.java:3683)
08-30 14:25:04.049: E/AndroidRuntime(843):  at java.lang.reflect.Method.invokeNative(Native Method)
08-30 14:25:04.049: E/AndroidRuntime(843):  at java.lang.reflect.Method.invoke(Method.java:507)
08-30 14:25:04.049: E/AndroidRuntime(843):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-30 14:25:04.049: E/AndroidRuntime(843):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-30 14:25:04.049: E/AndroidRuntime(843):  at dalvik.system.NativeStart.main(Native Method)
08-30 14:25:04.049: E/AndroidRuntime(843): Caused by: java.lang.reflect.InvocationTargetException
08-30 14:25:04.049: E/AndroidRuntime(843):  at java.lang.reflect.Constructor.constructNative(Native Method)
08-30 14:25:04.049: E/AndroidRuntime(843):  at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.view.LayoutInflater.createView(LayoutInflater.java:505)
08-30 14:25:04.049: E/AndroidRuntime(843):  ... 42 more
08-30 14:25:04.049: E/AndroidRuntime(843): Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x2
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:463)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.view.View.<init>(View.java:1957)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.TextView.<init>(TextView.java:344)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.CheckedTextView.<init>(CheckedTextView.java:58)
08-30 14:25:04.049: E/AndroidRuntime(843):  at android.widget.CheckedTextView.<init>(CheckedTextView.java:54)
08-30 14:25:04.049: E/AndroidRuntime(843):  ... 45 more

i think these are the most important points:

android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.CheckedTextView
...
Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x2
  • 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:22:45+00:00Added an answer on June 10, 2026 at 11:22 am

    Change:

    android:layout_height="?android:attr/listPreferredItemHeightSmall"
    

    to:

    android:layout_height="wrap_content"
    

    This will make your list’s rows expand to fit their content.

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

Sidebar

Related Questions

I have created an Android app using the standard controls available. It seems that
i have problem using LIKE structure in DB2 : for example: select * from
i have a problem using the Catch Clipboard Events code found on this link
I have an application built using PhoneGap (Android) that is essentially a shell for
Interesting problem I'm having with a ListView. It's using a standard ArrayAdapter, with a
I have a form that submits parameters using standard HTML controls to a PHP
Possible Duplicate: Standard Android Button with a different color I have 1 problem -
I just have learnt the hard way that standard android LVL + proguard does
I have problem using arabic font for iOS. All fonts have the same render,
I have problem while using jquery maskedinput with asp.net textbox. I have a check

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.