Java null point exxception occuring while trying out list view
<p>Error:</p>

<blockquote>
  <p>java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference</p>
</blockquote>

<p>Not getting anything, am confused!</p>

<p>Java code:</p>

<pre><code>package com.listview;

import android.app.Activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;


public class MainActivity extends Activity {
   ListView lvAndroid;
    @Override
     protected void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     String[] arrAndroid=    {"Cupcake","Donut","Jellybean","Kitkat","Lollipop","Marshmellow","Nougat"};



    ArrayAdapter adapt = new ArrayAdapter&lt;&gt;(this,R.layout.lv,arrAndroid);
   lvAndroid=(ListView)findViewById(R.id.lvAndroid);

    lvAndroid.setAdapter(adapt);
  }
}
</code></pre>

<p>Lv.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!--  Single List Item Design --&gt;

&lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/label"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="10dip"
    android:textSize="10sp"
    android:textStyle="bold" &gt;
&lt;/TextView&gt;
</code></pre>

<p>Main activity:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.listview.MainActivity"&gt;

&lt;ListView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/lvAndroid"
    android:layout_alignParentTop="true"
    android:layout_alignParentStart="true" /&gt; 
&lt;/RelativeLayout&gt;
</code></pre>