I m getting nothing here in main activity. plz help me out : [**enter image description here**][1]


  [1]: https://i.stack.imgur.com/iGOP3.jpg

I m doing it as a college project using Card View and List View. 
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. Join them; it only takes a minute:
The RecyclerView widget is a more advanced and flexible version of ListView. This widget is a container for displaying large data sets that can be scrolled very efficiently by maintaining a limited number of views. Use the RecyclerView widget when you have data collections whose elements change at runtime based on user action or network events.

The RecyclerView class simplifies the display and handling of large data sets by providing:

Layout managers for positioning items
Default animations for common item operations, such as removal or addition of items
You also have the flexibility to define custom layout managers and animations for RecyclerView widgets. 

my main_activity.xml



    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
    
        tools:context="sonu.myapplication.MainActivity">
        <android.support.v7.widget.Toolbar
            android:layout_width="match_parent"
            android:layout_height="?android:attr/actionBarSize"
            android:background="@color/colorPrimary"
            android:id="@+id/ToolbarMain">
    
        </android.support.v7.widget.Toolbar>
    
        <ListView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="10dp"
            android:dividerHeight="10dp"
            android:id="@+id/lvMain"
            android:layout_below="@id/ToolbarMain"
            android:divider="@null">
    
        </ListView>
        </RelativeLayout>
    
    
    
    
    
        enter code here
    <android.support.v7.widget.CardView android:layout_height="wrap_content"
    
        android:layout_width="match_parent"
        android:background="@color/colorAccent"
        android:elevation="4dp"
        xmlns:android="http://schemas.android.com/apk/res/android" >
    
        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
            <ImageView
                android:layout_width="80dp"
                android:layout_height="105dp"
                android:id="@+id/ivMain"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_marginStart="11dp"
                />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/tvMain"
                android:text="Timetable"
                android:layout_marginLeft="6dp"
                android:textStyle="bold"
                android:layout_toRightOf="@id/ivMain"
                android:textSize="24sp"
                />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/tvDescription"
                android:text="Description"
                android:layout_marginLeft="6dp"
                android:layout_below="@id/tvMain"
                android:layout_toRightOf="@id/ivMain"
                android:textSize="16dp"
                />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/tvClick"
                android:textSize="12dp"
                android:text="Click here"
                android:layout_alignParentRight="true"
                android:layout_marginTop="7dp"
                android:layout_below="@id/tvDescription"
                android:layout_alignBottom="@id/ivMain"
                />
        </RelativeLayout>
    </android.support.v7.widget.CardView>


    package sonu.myapplication;
    
    import android.content.Context;
    import android.os.Bundle;
    import android.support.v7.app.AppCompatActivity;
    import android.support.v7.widget.Toolbar;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.BaseAdapter;
    import android.widget.ImageView;
    import android.widget.ListView;
    import android.widget.TextView;
    
    public class MainActivity extends AppCompatActivity {
        private Toolbar toolbar;
        private ListView listView;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            setupUiViews();
            initToolbar();
    
        }
        private void setupUiViews(){
            toolbar=(Toolbar)findViewById(R.id.ToolbarMain);
            listView=(ListView)findViewById(R.id.lvMain);
    
    
        }
        private void initToolbar(){
            setSupportActionBar(toolbar);
            getSupportActionBar().setTitle("TimeTable App");
    
        }
        private void setUpListView(){
            String[] title = getResources().getStringArray(R.array.Main);
            String[] description = getResources().getStringArray(R.array.Description);
            SimpleAdapter simpleAdapter=new SimpleAdapter(this, title, description);
            listView.setAdapter(simpleAdapter);
        }
        public class SimpleAdapter extends BaseAdapter{
            private Context myContext;
            private LayoutInflater layoutInflater;
            private TextView title, description;
            private  String[] titleArray;
            private  String[] descriptionArray;
            private ImageView imageView;
    
            public SimpleAdapter(Context myContext, String[] titleArray, String[] descriptionArray){
                this.myContext=myContext;
                this.titleArray=titleArray;
                this.descriptionArray=descriptionArray;
                layoutInflater=LayoutInflater.from(myContext);
    
            }
    
            @Override
            public int getCount() {
                return titleArray.length;
            }
    
            @Override
            public Object getItem(int position) {
                return titleArray[position];
            }
    
            @Override
            public long getItemId(int position) {
                return position;
            }
    
            @Override
            public View getView(int position, View convertView, ViewGroup parent) {
                if(convertView==null){
                    convertView=layoutInflater.inflate(R.layout.main_activity_single_item, null);
    
    
                }
                title=(TextView)convertView.findViewById(R.id.tvMain);
                description=(TextView)convertView.findViewById(R.id.tvDescription);
                imageView=(ImageView)convertView.findViewById(R.id.ivMain);
    
                title.setText(titleArray[position]);
                description.setText(descriptionArray[position]);
    
                if (titleArray[position].equalsIgnoreCase("Timetable")){
                    imageView.setImageResource(R.drawable.timetable);
    
                }else if (titleArray[position].equalsIgnoreCase("Subjects")){
                    imageView.setImageResource(R.drawable.subjects);
                }else if (titleArray[position].equalsIgnoreCase("Faculty")){
                    imageView.setImageResource(R.drawable.teachers);
                }else if (titleArray[position].equalsIgnoreCase("resource")){
                    imageView.setImageResource(R.drawable.resource);
    
                }
                return convertView;
    
    
            }
        }
    }

and now my strings.xml

    <resources>
        <string name="app_name">My Application</string>
        <string-array name="Main">
            <item> Timetable </item>
            <item> Subjects </item>
            <item> Faculty </item>
            <item> Resources </item>
    
        </string-array>
        <string-array name="Description">
            <item> Description 1</item>
            <item> Description 2</item>
            <item> Description 3</item>
            <item> Description 4</item>
    
        </string-array>
    
    </resources>


