Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your exception has nothing to do with JSON parsing, it has to do with the Layout for your ListView. My guess is that somewhere in your Layout file you have something like this</p> <pre><code>&lt;TextView &lt;!-- params --&gt; &gt; &lt;!-- More Stuff --&gt; &lt;/TextView&gt; </code></pre> <p>That is not possible because TextView cannot have any other views inside of it. Make the layout in <code>R.Layout.listview</code> a <code>ViewGroup</code> such as a <code>LinearLayout</code> and then apply codeMagic's suggestions about requesting and parsing.</p> <p>Edit: I'm editing this a second time because I didn't read that layout close enough the first time. The underlying problem is that you have a <code>TextView</code> which is your top level element and contains other elements within it. Then, at inflation time, the LayoutInflater is trying to inflate your layout (don't worry about how this happens), and it is seeing "oh hey, this top level layout has other children within it, let me cast it to a <code>ViewGroup</code> so I can add children. However, a <code>TextView</code> is not a view group and has no children, so that <code>ClassCastException</code> gets thrown.</p> <p>More importantly, it seems like you don't fully understand how Adapters on lists work. You need to have a separate layout which contains information on how any one item in the <code>ListView</code> looks; then your mapping needs to reference TextViews within THAT layout. When you attach the adapter, every item within the <code>ListView</code> inflates the smaller layout that you pointed to in your <code>setAdapter</code> call and sets the <code>TextView</code>s in that smaller layout. These smaller layouts are then placed one on top of the other to make your list.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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