data from Database access error in android
<pre><code>public String[] getdata()
    {
        try
           {
            myDB = this.openOrCreateDatabase("Task", MODE_PRIVATE, null);

            Cursor c=myDB.rawQuery("SELECT * from "+TableName+";",null);
            c.moveToFirst();


            for(int i=0;i&lt;c.getCount();++i)
            {
                 String str0=c.getString(0);
             System.out.println(str0);
                 arr[i]=str0;

                c.moveToNext();

            }    

           }
           catch(Exception e)
           {
               e.printStackTrace();
           }
           finally
           {
               myDB.close();
           }

           return arr;
    }
</code></pre>

<p>this is my function whats wrong in it ..it is showing the apllication has stopped unexpectedly please help.. 
err is</p>

<pre><code>11-29 14:47:07.443: WARN/SQLiteDirectCursorDriver(716): Found SQL string that ends in ; -- SELECT * from Task;
11-29 14:47:07.453: INFO/System.out(716): ghgf
11-29 14:47:07.453: INFO/System.out(716): ghgf
11-29 14:47:07.453: INFO/System.out(716): ghgf
11-29 14:47:07.463: INFO/System.out(716): ghgf
11-29 14:47:07.463: INFO/System.out(716): ghgf
11-29 14:47:07.744: DEBUG/AndroidRuntime(716): Shutting down VM
11-29 14:47:07.744: WARN/dalvikvm(716): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)
11-29 14:47:07.754: ERROR/AndroidRuntime(716): Uncaught handler: thread main exiting due to uncaught exception
11-29 14:47:07.773: ERROR/AndroidRuntime(716): java.lang.NullPointerException
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:355)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.AbsListView.obtainView(AbsListView.java:1273)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.ListView.makeAndAddView(ListView.java:1658)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.ListView.fillDown(ListView.java:637)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.ListView.fillFromTop(ListView.java:694)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.ListView.layoutChildren(ListView.java:1516)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.AbsListView.onLayout(AbsListView.java:1112)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.view.View.layout(View.java:6569)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.view.View.layout(View.java:6569)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.view.View.layout(View.java:6569)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.view.View.layout(View.java:6569)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.view.ViewRoot.performTraversals(ViewRoot.java:979)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1613)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.os.Handler.dispatchMessage(Handler.java:99)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.os.Looper.loop(Looper.java:123)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at android.app.ActivityThread.main(ActivityThread.java:4203)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at java.lang.reflect.Method.invokeNative(Native Method)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at java.lang.reflect.Method.invoke(Method.java:521)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
11-29 14:47:07.773: ERROR/AndroidRuntime(716):     at dalvik.system.NativeStart.main(Native Method)
11-29 14:47:07.793: INFO/Process(63): Sending signal. PID: 716 SIG: 3
</code></pre>
