Note that there are some explanatory texts on larger screens.

plurals
  1. POPull to refresh on Android crashes on Inflater
    text
    copied!<p>I've downloaded <a href="https://github.com/johannilsson/android-pulltorefresh" rel="nofollow">pull to refresh widget</a> for android and now I'm trying to make it work. I copied everything from the plugin and plugin example folder into my project, changed the import reference to R in com.markupartist.android.widget.PullToRefreshListView to my project's R file. Worked fine at this point.</p> <p>Then I have added another layout into res/layout and started to get weird error messages. This layout is not anyhow used in my project, I just put the file in place. Current exception message is: <em>your content must have a listview whose id attribute is 'android.r.id.list'</em> (there is still the listview in pull_to_refresh.xml from the example project with this id, not anyhow changed). Content of my added xml file (named crasher.xml) is:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="5dip" &gt; &lt;!-- Article title --&gt; &lt;TextView android:id="@+id/alr_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:text="Article title" android:textColor="#040404" android:typeface="sans" android:textSize="15dip" android:textStyle="bold"/&gt; &lt;/RelativeLayout&gt; </code></pre> <p>As I change this newly added layout, the exception sometimes varies and is thrown from line 93 of PullToRefreshListView.java, where the inflater is called to inflate the pull_to_refresh_header file. I am almost sure there is a problem with the inflater and somehow conflicting layouts. For a moment I was getting an error on this line saying that I cannot cast RelativeLayout to LinearLayout (I am not aware of doing it anywhere) - now I don`t remember what exactly I did and cannot reproduce it, but it was only in changing views in the added and unused layout crasher.xml.</p> <p>I do not perfectly understand the inflating process and cannot determine where is the problem, can anyone help me?</p> <p>thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload