title: FrameLayout cannot be cast to android.widget.AbsListView
body: <p>I would like to set a footer to list view. but I get below errors :</p>
  
  <pre><code> &gt;     : FATAL EXCEPTION: main
   &gt;     08-19 07:26:53.225: E/AndroidRuntime(1176): java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams
   &gt; cannot be cast to android.widget.AbsListView$LayoutParams
   &gt;     08-19 07:26:53.225: E/AndroidRuntime(1176):  at android.widget.ListView.clearRecycledState(ListView.java:513)
   &gt;     08-19 07:26:53.225: E/AndroidRuntime(1176):  at android.widget.ListView.resetList(ListView.java:500)
   &gt;     08-19 07:26:53.225: E/AndroidRuntime(1176):  at android.widget.ListView.setAdapter(ListView.java:442)
   &gt;     08-19 07:26:53.225: E/AndroidRuntime(1176):  at .SimpeSearch.onClick(SimpeSearch.java:91)
  </code></pre>
  
  <hr>
  
  <p>line 91 is setAdapter method :</p>
  
  <pre><code>FrameLayout footerLayout = (FrameLayout) getLayoutInflater().inflate(R.layout.footer_loadmore,null);
  TextView footer = (TextView) footerLayout.findViewById(R.id.footer);
  
  
  
  listview.addFooterView(footer);
  
          AdapterSimpleSearch ad = new AdapterSimpleSearch(this,R.layout.row_list_simple_search,10, footer);
  listview.setAdapter(ad); 
  </code></pre>
  
  <p>footer_loadmore :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:padding="6dp"
  &gt;
  
  &lt;TextView android:id="@+id/footer"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center"
      android:textAppearance="@android:style/TextAppearance.Medium"
      android:text="Loading..."
      /&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>constructor :</p>
  
  <pre><code>public AdapterSimpleSearch(Context context,int layoutResourceId,int pageSize, TextView footer){
      super(context,layoutResourceId);
  </code></pre>
  
  <p>how can I fix it ?</p>
  
  <p>updated :</p>
  
  <p>my adapter :</p>
  
  <pre><code>public AdapterSimpleSearch(Context context,int layoutResourceId,int pageSize, TextView footer){
      super(context,layoutResourceId);
      helperbooks = new ArrayList&lt;&gt;(); 
      this.context            = context ;
      //this.helperbooks      = hbooks ;
      this.mFooter = footer ;
      inflater = (LayoutInflater)this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      this.mPageSize = pageSize ;
  
  }
  
  public void notifyNoMoreItems(){
      mHasMoreItems = false;
      mFooter.setText("No more Items");
  }
  
  
  @Override
  public int getCount() {
      // TODO Auto-generated method stub
      return this.helperbooks.size();
  }
  
  
  @Override
  public long getItemId(int position) {
      // TODO Auto-generated method stub
      return position;
  }
  
  
  public static class ViewHolder{
  
      TextView txt_view_title,txt_view_author,txt_view_publisher ;
  
  }
  
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      // TODO Auto-generated method stub
  
      if(position == getCount() - 1 &amp;&amp; mHasMoreItems){
          LoaderTaskSimpleSearch t = new LoaderTaskSimpleSearch(position + 1, position + 1 + mPageSize, context,this,"book");
          t.execute();
          mFooter.setText("Loading . . .");
      }
  
  
      ViewHolder viewholder ;
  
      if(convertView == null){
          convertView = this.inflater.inflate(R.layout.row_list_simple_search, null);
          viewholder = new ViewHolder();
  
          viewholder.txt_view_title       = (TextView)convertView.findViewById(R.id.txt_view_title_list_simple_search);
          viewholder.txt_view_author      = (TextView)convertView.findViewById(R.id.txt_view_author_list_simple_search);
          viewholder.txt_view_publisher   = (TextView)convertView.findViewById(R.id.txt_view_publisher_list_simple_search);
          convertView.setTag(viewholder);
  
      }else
  
          viewholder = (ViewHolder)convertView.getTag();
  
      viewholder.txt_view_title.setText(helperbooks.get(position).getTitle());
      viewholder.txt_view_author.setText(helperbooks.get(position).getAuthor());
      viewholder.txt_view_publisher.setText(helperbooks.get(position).getPublisher());
  
      return convertView;
  }
  </code></pre>
  
  <p>}</p>