Android Open Source - roommates Drawer List Adapter

From Project

Back to project page roommates.


The source code is released under:

Apache License

If you think the Android project roommates listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.mattieapps.roommates;
//from w w  w.  ja  v  a 2 s. c  om
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

 * Created by andrewmattie on 11/28/14.
public class DrawerListAdapter extends BaseAdapter {

    private Context context;
    private String[] mtitle;
    private int[] micon;
    private LayoutInflater inflater;

    public  DrawerListAdapter(Context context, String title[], int icon[])

    public int getCount() {
        return mtitle.length;

    public Object getItem(int arg0) {
        return arg0;

    public long getItemId(int arg0) {
        return arg0;

    public View getView(int position, View arg1, ViewGroup parent) {

        TextView title;
        //TextView subtitle;
        ImageView icon;

        inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View itemView = inflater.inflate(R.layout.drawer_item, parent, false);

        title = (TextView) itemView.findViewById(;
        icon = (ImageView) itemView.findViewById(;


        return itemView;



Java Source Code List