title: NullPointerException at android widget ArrayAdapter
body: <pre><code>private void fillArrayAdapter() {
          Cursor c = db.rawQuery("SELECT * FROM quotes", null);
          int count = c.getCount();
          int column = c.getColumnCount();
          Log.d("countcl", column + "");
          totalRec = new String[count * column];
          Log.d("counttot", totalRec + "");
          int i = 0;
          c.moveToFirst();
          while (!c.isAfterLast()) {
              totalRec[i++] = c.getString(c.getColumnIndex("qoutemsg"));
              c.moveToNext();
          }
  
          ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(
                  getBaseContext(), R.layout.activity_customview, R.id.tv,
                  totalRec);
          lv1 = (ListView) findViewById(R.id.listViewQuotes);
          lv1.setAdapter(adapter);
  
      }
  </code></pre>
  
  <p>Logcat</p>
  
  <pre><code>11-25 22:43:26.982: E/AndroidRuntime(17543): FATAL EXCEPTION: main
  11-25 22:43:26.982: E/AndroidRuntime(17543): java.lang.NullPointerException
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:394)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at android.widget.AbsListView.obtainView(AbsListView.java:2191)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at android.widget.ListView.makeAndAddView(ListView.java:1840)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at android.widget.ListView.fillDown(ListView.java:675)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at android.widget.ListView.fillGap(ListView.java:639)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at android.widget.AbsListView.trackMotionScroll(AbsListView.java:5128)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:4188)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at android.view.Choreographer.doCallbacks(Choreographer.java:562)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at android.view.Choreographer.doFrame(Choreographer.java:531)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at android.os.Handler.handleCallback(Handler.java:730)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at android.os.Handler.dispatchMessage(Handler.java:92)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at android.os.Looper.loop(Looper.java:137)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at android.app.ActivityThread.main(ActivityThread.java:5155)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at java.lang.reflect.Method.invokeNative(Native Method)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at java.lang.reflect.Method.invoke(Method.java:525)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:756)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:572)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at miui.dexspy.DexspyInstaller.main(DexspyInstaller.java:171)
  11-25 22:43:26.982: E/AndroidRuntime(17543):    at dalvik.system.NativeStart.main(Native Method)`
  </code></pre>