ArrayAdapter Display Onyl One Record
<p>Good Afternoon,</p>

<p>I have asked this question before with other adapters like SimpleAdapter but the solution for the simple adapter is not working for ArrayAdapter. In a SimpleAdapter I got the screen width &amp; height then passed that to my RelativeLayout for the data row. The effect was that only one record filling the entire screen was shown at a time. That was fine with static data but now I want to use mutable data. In short I really don't want to pass the height and width at all. My xml layout is using dip so the screen sizes can change all they want. What I am REALLY after is a way to control the getView call to just one record at a time.</p>

<p>Anyway using the workaround from SimpleAdapter I thought passing the height and width just like before would work but for some reason this time I'm getting an error I can't figure out. Here is the code that sets the width and height:</p>

<pre><code>RelativeLayout.LayoutParams szParms = new RelativeLayout.LayoutParams(mWidth, mHeight);
vw_BigRow.setLayoutParams(szParms);
</code></pre>

<p>The height and width are determined elsewhere and are accurate across all devices I've tested with.
Not really sure what else to post so just tell me and I add that code / info to the question.</p>

<pre><code>E/AndroidRuntime(404): FATAL EXCEPTION: main
E/AndroidRuntime(404): java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams
</code></pre>

<p><strong>Edit:</strong>
As has been correctly pointed out my error occurs with a CastClassException however I am still not doing the assignment right as I continue to get the error. I have tried in the activity to set the height / width with the following:</p>

<pre><code>AbsListView.LayoutParams szParms = new AbsListView.LayoutParams(mWidth, mHeight);
lstvw_LiftData.setLayoutParams(szParms);

E/AndroidRuntime(1886): FATAL EXCEPTION: main
E/AndroidRuntime(1886): java.lang.ClassCastException: android.widget.AbsListView$LayoutParams
</code></pre>

<p>and</p>

<pre><code>ListView.LayoutParams szParms = new ListView.LayoutParams(mWidth, mHeight);
lstvw_LiftData.setLayoutParams(szParms);

E/AndroidRuntime(1886): FATAL EXCEPTION: main
E/AndroidRuntime(1886): java.lang.ClassCastException: android.widget.AbsListView$LayoutParams
</code></pre>

<p>the lstvw_LiftData is a valid ref and not null.</p>

<p>Inside the getView() override of the ArrayAdapter I also try to set the values with the same result
    @Override 
    public View getView(int position, View convertView, ViewGroup parent) 
    {...}</p>

<p>The only thing I can get to work is this and then a couple, Not All, but a couple of my elements are ignoring their layout positioning and going straigtht to the bottom.</p>

<pre><code>View vw_BigRow = convertView;

if (vw_BigRow == null) 
{
    LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    vw_BigRow = inflater.inflate(R.layout.liftdatalayout, null);
}

vw_BigRow.setMinimumHeight(mHeight);
vw_BigRow.setMinimumWidth(mWidth);
</code></pre>
