Application got stuck
<p>I am developing a application and wrote a cursor to retrieve data from a database, but after starting the application it is getting stuck at some point.</p>

<p>Logcat:</p>

<pre><code>04-29 16:05:23.328: I/System.out(9429): Database is opened
04-29 16:05:23.737: I/Choreographer(9429): Skipped 31 frames!  The application may be doing too much work on its main thread.
04-29 16:05:23.817: D/gralloc_goldfish(9429): Emulator without GPU emulation detected.
</code></pre>

<p>Can anyone please suggest what could be done to fix this?
Code:
My code goes like this when control comes to "Database Opened" it is not going forward.. Meanwhile I am trying to insert and retrive data from database.</p>

<pre><code>import android.content.Context;
import android.database.Cursor;
import android.database.DatabaseErrorHandler;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import android.widget.Toast;

import com.example.project.R;

public class Database  extends SQLiteOpenHelper{

    static final String dbname="Project";
    static final int dbversion=1;

    TableA r=new TableA();


    SQLiteDatabase db;
    private Context Context;
    public Database(Context context) {
        super(context,  dbname, null, dbversion);
        try{
        db=getWritableDatabase();
        // TODO Auto-generated constructor stub
        if (db.isOpen()){

            System.out.println("Database is opened");
        }
            else{


                System.out.println("Database is not opened");
            }

        }
        catch(Exception e){

            Log.e(dbname, e.getMessage());

        }
    }


    @Override
    public void onCreate(SQLiteDatabase db) {

        // TODO Auto-generated method stub
        try{
        db.beginTransaction();

        db.execSQL(r.r_Table);


        db.insert(r.Tablename, null, r.insertdata());
        db.setTransactionSuccessful();
        retrivedata();
        }
        catch(Exception e){

            android.util.Log.e(r.Tablename, e.getMessage());

        }

        finally{

            db.endTransaction();
        }


    }//

    public void retrivedata(){

    Cursor c=db.rawQuery("Select * from Region", null);

    if (c != null ) {
        if  (c.moveToFirst()) {

            System.out.println("Rows are:"+c.getCount());

    }


}
    c.close();

}
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // TODO Auto-generated method stub

    }

}
</code></pre>

<p>Thanks
Siva</p>
