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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:06:04+00:00 2026-05-24T12:06:04+00:00

I have a subclass of ListView. My only problem is I can’t get it

  • 0

I have a subclass of ListView. My only problem is I can’t get it to work (not the listview code, but the code to use the listview. Android won’t inflate it (app crashes). I’m sure there is a simple way to get this to work, but I don’t know how.

PullToRefreshListView list;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.cliplistmain);

    context = this;
    list = (PullToRefreshListView)findViewById(R.id.clipListMain);
    list.setOnItemClickListener(this);
    list.setOnScrollListener(this);

    list.setOnRefreshListener(new OnRefreshListener(){
        @Override
        public void onRefresh() 
        {
            ClipStore.getInstance().getClips(SugarLoafContext.currentCamera);
        }
    });

    Button btn = (Button)findViewById(R.id.findclipsbtn);
    btn.setOnClickListener(this);
    SugarLoafContext.lastView = SugarLoafContext.LAST_VIEW_CLIP_LIST;

}

Here is my xml:

<ListView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/clipListMain" >

  • 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-05-24T12:06:05+00:00Added an answer on May 24, 2026 at 12:06 pm

    This is only a part of your layout xml file right, so you do have header and namespace information in your XML.

    I guess you get a ClassCastException or similar right? Since you’ve got a ListView in your xml but cast it into your PullToRefreshListView class.

    Your layout xml (i.e. ./res/layout/foo.xml) should be something like

    <?xml version="1.0" encoding="utf-8"?>
    <com.yourpackage.foo.PullToRefreshListView
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res/com.yourpackage.foo"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/clipListMain" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a subclass of UITableViewController. I have code that can add/remove a UISearchBar
I have followed this tutorial to get my ListView populating data -- http://android.amberfog.com/?p=296 .
I have a subclass of NSView where I'm handling the -mouseDown: event to get
I have a subclass of QTableWidget with the following code: connect(this, SIGNAL(cellChanged(int, int)), this,
I have a ListView subclass that display rows that each contain an EditText and
I have a subclass of UITableViewCell and am trying to use it. At the
I have a subclass of CursorAdapter and I would like to filter my listview.
I have a subclass and I want it to not include a class attribute
I have to implement a sort of pagination for a subclass of ListView .
In android, I have a List Activity (subclass from ListActivity). And i want to

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.