so I am working on an app, and I just started learning SQLite for android, apparently I am stuck for 3 days now on one problem.
This is my Code For the DbHelper Class:
package com.example.emp_management;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
public class DatabaseHelper extends
How come whenever I clear my app data, my previously working SQLite database doesn't work anymore?
here is my code for my database:
package tsu.ccs.capstone;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHe
can you please help me in may android project.. im having a problem with my database.
So I have the following piece of code, the code trys to add data to a database and if can't it closes the app.
So I am creating a trivia game, my problem is trying to add questions to the database. I figure it doesn't matter if the whole table got deleted but I just cant seem it get it to work. I've looked over countless posts and cannot figure out what i am doing wrong.
I have made a Database and a table which is working fine. Now i wish to retrieve the entered data in the table and display it in TextView . But i am not able to do it. I am sharing the code and log cat .
Don't know what is the reason why i can't fetch the data i needed in my database
there isn't an error to my code but it doesn't work
here is my databasehelper
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class DatabaseHelper extends SQL
// Mystock.java
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;