title: Custom List view for a sliding menu
body: <p>*<em>EDIT:</em>*Ive got this to work now. Made the necessary changes in the code below.</p>
  
  <p>I am trying to create a slidng menu in and android application. The sliding menu must contain a customized list view with an image and a text view. Although I am able to get the sliding menu, I cannot seem to get any content into the list view.</p>
  
  <p>This is my Main activity:</p>
  
  <pre><code>public class Main extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      final Context context=this;
      LayoutInflater inflater=(LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      View v=inflater.inflate(R.layout.slidingmenu, null, true);
  
  
  
      final ListView lv=(ListView) v.findViewById(R.id.listView);
  
      SlidingMenu menu=new SlidingMenu(this);
      menu.setMode(SlidingMenu.LEFT);
      menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
      menu.setShadowWidth(5);
      menu.setFadeDegree(0.0f);
      menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
      menu.setBehindWidth(100);
      menu.setMenu(v);
      menu.setOnOpenListener(new OnOpenListener() {
  
          @Override
          public void onOpen() {
              MenuAdapter ma=new MenuAdapter(context);
              lv.setAdapter(ma);
          }
      });
  
  
  }
  </code></pre>
  
  <p>My Adapter class:</p>
  
  <pre><code>public class MenuAdapter extends ArrayAdapter&lt;String&gt;{
  Context context;
  
  @Override
  public int getCount() {
      return 2;
  }
  
  public MenuAdapter(Context c) {
      super(c, R.layout.menucontent);
      context=c;
  
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      /*int height=LinearLayout.LayoutParams.MATCH_PARENT;
      int width=LinearLayout.LayoutParams.MATCH_PARENT;*/
  
  
      LayoutInflater inflater=(LayoutInflater) context.
              getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
      View view=inflater.inflate(R.layout.menucontent, parent, false);
      TextView tv=(TextView) view.findViewById(R.id.tv_content);
  
      tv.setText("Hello World");
  
      return view;
  }   
  </code></pre>
  
  <p>}</p>
  
  <p>P.S: I have 3 different XML files- main.xml which is the launcher activity, slidingmenu.xml which displays the menu and finally menucontent.xml which has the text and image views that should be displayed in the list.</p>