title: Null Pointer exception on Attempt to invoke virtual method 'int android.view.View.getImportantForAccessibility()
body: <p>I am having a list view with custom adapter inside a fragment but I am unable to resolve it , I had tried other answers which directed me towards returning convertview from getView() but it did not help .</p>
  
  <p><strong>MyIssueFragment.java</strong></p>
  
  <pre><code>public class MyIssuesFragment extends Fragment
  {
      private static final String TAG = MyIssuesFragment.class.getSimpleName();
      ArrayList&lt;Issue&gt; arrayList;
      ListView issueListView;
      public MyIssuesFragment()
      {
          // Required empty public constructor
      }
      public static MyIssuesFragment newInstance()
      {
          return new MyIssuesFragment();
      }
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
      {
          View rootView = inflater.inflate(R.layout.fragment_my_issues, container, false);
          arrayList = new ArrayList&lt;&gt;();
          HashMap&lt;String,String&gt; hashMap = new HashMap&lt;&gt;();
          hashMap.put("userid",HomeActivity.USER_ID);
          issueListView = (ListView) rootView.findViewById(R.id.list_view);
          PostRequestSend prs = new PostRequestSend("http://snapimpact.esy.es/php_codes/my_issues.php",hashMap);
          prs.setTaskDoneListener(new PostRequestSend.TaskDoneListener()
          {
              @Override
              public String onTaskDone(String str) throws JSONException
              {
                  Log.e(TAG, "onTaskDone:  " + str );
                  JSONArray jsArray = new JSONArray(str);
                  int len = jsArray.length();
                  for (int i = 0 ; i &lt; len ; i++)
                  {
                      arrayList.add(i,new Issue(jsArray.getJSONObject(i)));
                  }
  
  
                  return str;
  
  
              }
          });
          prs.execute();
          issueListView.setAdapter(new MyAdapter(arrayList,getContext()));
          return rootView;
      }
      public  class MyAdapter extends BaseAdapter{
          private Context context;
          private ArrayList&lt;Issue&gt; arr;
          public MyAdapter(ArrayList&lt;Issue&gt; arr , Context context)
          {
              this.arr = arr;
              this.context = context;
          }
  
          @Override
          public int getCount()
          {
              Log.e(TAG, "getCount: " + arr.size() );
              return arr.size();
          }
          @Override
          public Issue getItem(int position)
          {
              return arr.get(position);
          }
          @Override
          public long getItemId(int position)
          {
              return 0;
          }
          @Override
          public View getView(int position, View convertView, ViewGroup parent)
          {
              LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              convertView = layoutInflater.inflate(R.layout.single_issue_layout,null);
              return convertView;
          }
      }
  }
  </code></pre>
  
  <p><strong>single_issue_layout.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
           android:orientation="vertical"
                android:layout_width="match_parent"
                android:layout_height="match_parent"&gt;
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:hint="aalo"
      android:id="@+id/id_1"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>fragment_my_issues.xml</strong></p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
               xmlns:tools="http://schemas.android.com/tools"
               android:layout_width="match_parent"
               android:layout_height="match_parent"
  
               tools:context="com.example.dam.snapimpact.MyIssuesFragment"&gt;
  
      &lt;!-- TODO: Update blank fragment layout --&gt;
  &lt;ListView
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/list_view"/&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p><strong>Logcat</strong></p>
  
  <pre><code>10-15 10:02:06.514 12114-12114/com.example.dam.snapimpact E/AndroidRuntime: FATAL EXCEPTION: main
  Process: com.example.dam.snapimpact, PID: 12114
  java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getImportantForAccessibility()' on a null object reference
  at android.widget.AbsListView.obtainView(AbsListView.java:2363)
  at android.widget.ListView.makeAndAddView(ListView.java:1876)
  at android.widget.ListView.fillDown(ListView.java:702)
  at android.widget.ListView.fillFromTop(ListView.java:763)
  at android.widget.ListView.layoutChildren(ListView.java:1685)
  at android.widget.AbsListView.onLayout(AbsListView.java:2148)
  at android.view.View.layout(View.java:16651)
  at android.view.ViewGroup.layout(ViewGroup.java:5440)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
  at android.view.View.layout(View.java:16651)
  at android.view.ViewGroup.layout(ViewGroup.java:5440)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
  at android.view.View.layout(View.java:16651)
  at android.view.ViewGroup.layout(ViewGroup.java:5440)
  at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
  at android.view.View.layout(View.java:16651)
  at android.view.ViewGroup.layout(ViewGroup.java:5440)
  at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:122)
  at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)
  at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1192)
  at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:814)
  at android.view.View.layout(View.java:16651)
  at android.view.ViewGroup.layout(ViewGroup.java:5440)
  at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1187)
  at android.view.View.layout(View.java:16651)
  at android.view.ViewGroup.layout(ViewGroup.java:5440)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
  at android.view.View.layout(View.java:16651)
  at android.view.ViewGroup.layout(ViewGroup.java:5440)
  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
  at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
  at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
  at android.view.View.layout(View.java:16651)
  at android.view.ViewGroup.layout(ViewGroup.java:5440)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
  at android.view.View.layout(View.java:16651)
  at android.view.ViewGroup.layout(ViewGroup.java:5440)
  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
  at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
  at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
  at android.view.View.layout(View.java:16651)
  at android.view.ViewGroup.layout(ViewGroup.java:5440)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
  at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678)
  at android.view.View.layout(View.java:16651)
  at android.view.ViewGroup.layout(ViewGroup.java:5440)
  at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2183)
  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1943)
  at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1119)
  at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6060)
  at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
  at android.view.Choreographer.doCallbacks(Choreographer.java:670)
  at android.view.Choreographer.doFrame(Choreographer.java:606)
  at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
  at android.os.Handler.handleCallback(Handler.java:746)
  at android.os.Handler.dispatchMessage(
  </code></pre>