title: java.lang.IllegalStateException: this should only be called when the cursor is valid
body: <p>I am working with fragment in android 2.1 for this I am using supportV4 jar. I have two fragment in one activity one for new data insert and other for display list ,I am using ResourceCursorAdapter in fragment to display all data from cursor but when I move from this activity to another activity I am getting force close it generates error like this</p>
  
  <pre><code>    07-23 18:26:13.028: E/AndroidRuntime(25309): java.lang.IllegalStateException: this should only be called when the cursor is valid
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.support.v4.widget.CursorAdapter.getView(CursorAdapter.java:245)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.widget.AbsListView.obtainView(AbsListView.java:1315)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.widget.ListView.measureHeightOfChildren(ListView.java:1198)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.widget.ListView.onMeasure(ListView.java:1109)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.view.View.measure(View.java:8171)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:381)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.view.View.measure(View.java:8171)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.view.View.measure(View.java:8171)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1029)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.view.View.measure(View.java:8171)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:526)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.view.View.measure(View.java:8171)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.view.View.measure(View.java:8171)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:526)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.view.View.measure(View.java:8171)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.view.View.measure(View.java:8171)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.view.View.measure(View.java:8171)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.view.ViewRoot.performTraversals(ViewRoot.java:801)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.os.Handler.dispatchMessage(Handler.java:99)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.os.Looper.loop(Looper.java:123)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at android.app.ActivityThread.main(ActivityThread.java:4627)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at java.lang.reflect.Method.invokeNative(Native Method)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at java.lang.reflect.Method.invoke(Method.java:521)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  07-23 18:26:13.028: E/AndroidRuntime(25309):    at dalvik.system.NativeStart.main(Native Method)
  </code></pre>