Android,CustomListView
<p>How could i decide size of each line in a ListView?</p>

<p>My problem is that i have a list of text and now each text (each line) is different in length but the size of the text is the same, so the problem is if the text is big  my ListView will not be adjust for the text and will cut part of it.</p>

<p>I use this class to build the  ListView:</p>

<pre><code>    private class ListAdapter extends ArrayAdapter&lt;Medicaments&gt; {  // --CloneChangeRequired
    private ArrayList&lt;Med&gt; mList;  // --CloneChangeRequired
    private Context mContext;

    public ListAdapter(Context context, int textViewResourceId,ArrayList&lt;Med&gt; list) { // --CloneChangeRequired
        super(context, textViewResourceId, list);
        this.mList = list;
        this.mContext = context;
    }

    public View getView(int position, View convertView, ViewGroup parent)
    {
        View view = convertView;
        try{
        if (view == null) {
            LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            view = vi.inflate(R.layout.singleresult, null);     // --CloneChangeRequired(list_item)
        }

        final Med listItem = mList.get(position);   // --CloneChangeRequired

        String Res=listItem.getMed().substring(0, 1).toUpperCase()+listItem.getMed().substring(1).toLowerCase();
         Res=WordUtils.capitalize(Res);
        if (listItem != null) {


            ( (TextView) view.findViewById(R.id.resultTextView) ).setText( Res+"\n");

        }}catch(Exception e){
            Log.i(ResultView.ListAdapter.class.toString(), e.getMessage());             
        }
        return view;
    }




}
</code></pre>

<p>Thanks for helping!!</p>
