嗨,我正在尝试创建一个android测验应用程序,当我从菜单中选择测验活动时,该应用程序崩溃,因此我无法锻炼为什么会收到此错误。任何帮助将不胜感激。我已经在上面包含了错误日志,并将在下面包括相关文件。
测验的XML布局文件
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:padding="10dp"
tools:context=".MainActivityQuizBasics">
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|left"
android:background="@drawable/rect_background_pink">
<TextView
android:id="@+id/qstnNo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:singleLine="true"
android:text="01/30"
android:textColor="@color/white"
android:textSize="20dp"
android:textStyle="bold" />
</RelativeLayout>
<TextView
android:id="@+id/textViewTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="05:00"
android:textColor="@color/colorAccent"
android:textSize="25dp"
android:textStyle="bold" />
</RelativeLayout>
<ProgressBar
android:id="@+id/progressBar"
style="@style/CustomProgressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:max="30" />
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/colorPrimaryDark" />
<RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_weight="0.03">
<RadioButton
android:id="@+id/radio0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="false"
android:text="RadioButton"
android:textColor="@color/colorPrimaryDark" />
<RadioButton
android:id="@+id/radio1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="RadioButton"
android:textColor="@color/colorPrimaryDark" />
<RadioButton
android:id="@+id/radio2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="RadioButton"
android:textColor="@color/colorPrimaryDark" />
<RadioButton
android:id="@+id/radio3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="RadioButton"
android:textColor="@color/colorPrimaryDark" />
</RadioGroup>
</LinearLayout>
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="30dp"
android:layout_marginTop="15dp"
android:layout_marginRight="30dp"
android:background="@color/deeppurple"
android:fontFamily="sans-serif"
android:text="NEXT"
android:textColor="#fff" />
MainActivityQuizBasics.java -测验活动
package com.example.hp.demo;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import com.example.hp.demo.DbHelper.DatabaseHelper;
import com.example.hp.demo.Model.QuestionBasics;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.concurrent.TimeUnit;
public class MainActivityQuizBasics extends AppCompatActivity {
public int score = 0;
public ArrayList<String> wrongQuestListBasics = new ArrayList<String>();
public ArrayList<String> selectedBasics = new ArrayList<String>();
public ArrayList<String> actualAnswerBasics = new ArrayList<String>();
List<QuestionBasics> quesList1;
int ctr1 = 1;
QuestionBasics currentQ1;
TextView txtQuestion1;
RadioGroup grp;
RadioButton rda1, rdb1, rdc1, rdd1;
Button butNext1;
Random random1 = new Random();
ArrayList<Integer> list = new ArrayList<Integer>();
TextView textViewTime1;
int number;
ProgressBar progressBar;
int progress = 1;
String tableName = "", catName = "";
TextView qstnNo;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_questions_basics);
qstnNo = findViewById(R.id.qstnNo);
Intent iin = getIntent();
Bundle b = iin.getExtras();
if (b != null) {
tableName = (String) b.get("table_name");
catName = (String) b.get("level_name");
Log.d("Table Name", tableName);
Log.d("Level Name", catName);
}
number = 0;
DatabaseHelper db = new DatabaseHelper(this);
//db.addBasicsTable(tableName,catName);
textViewTime1 = findViewById(R.id.textViewTime);
final CounterClass timer = new CounterClass(1800000, 1000);
timer.start();
quesList1 = db.getAllQuestions1("questBasics", catName);
for (int i = 0; i < 50; i++) {
while (true) {
int next = random1.nextInt(50);
if (!list.contains(next)) {
list.add(next);
break;
}
}
}
currentQ1 = quesList1.get(0);
txtQuestion1 = findViewById(R.id.textView1);
rda1 = findViewById(R.id.radio0);
rdb1 = findViewById(R.id.radio1);
rdc1 = findViewById(R.id.radio2);
rdd1 = findViewById(R.id.radio3);
butNext1 = findViewById(R.id.button1);
setQuestionView();
grp = findViewById(R.id.radioGroup1);
butNext1.setEnabled(false);
grp.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup, int i) {
if (i == R.id.radio0 || i == R.id.radio1 || i == R.id.radio2 || i == R.id.radio3)
butNext1.setEnabled(true);
}
});
progressBar = findViewById(R.id.progressBar);
progressBar.setMax(30);
progressBar.setProgress(1);
butNext1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
progress = progress + 1;
progressBar.setProgress(progress);
RadioButton answer = findViewById(grp.getCheckedRadioButtonId());
//Log.d("yourans", currentQ1.getANSWER1() + " " + answer.getText());
if (currentQ1.getANSWER1().equals(answer.getText())) {
score++;
//Log.d("score", "Your score" + score1);
} else {
wrongQuestListBasics.add(number, currentQ1.getQUESTION1());
selectedBasics.add(number, answer.getText().toString());
actualAnswerBasics.add(number, currentQ1.getANSWER1());
number++;
}
grp.clearCheck();
butNext1.setEnabled(false);
if (ctr1 < 31) {
if (ctr1 == 30) {
butNext1.setText("End Quiz");
}
currentQ1 = quesList1.get(list.get(ctr1));
setQuestionView();
} else {
timer.onFinish();
timer.cancel();
}
}
});
}
public void showResult() {
Intent intent = new Intent(MainActivityQuizBasics.this, ResultActivity.class);
Bundle b = new Bundle();
b.putInt("scoreBasics", score);//Your score
b.putString("section", "questBasics");//Your table name
b.putString("category", catName);//Your category name
intent.putStringArrayListExtra("wrongQuestions", wrongQuestListBasics);
intent.putStringArrayListExtra("selectedAnswer", selectedBasics);
intent.putStringArrayListExtra("actualAnswer", actualAnswerBasics);
intent.putExtras(b); //Put your score to your next Intent
startActivity(intent);
finish();
}
private void setQuestionView() {
txtQuestion1.setText(currentQ1.getQUESTION1());
rda1.setText(currentQ1.getOPTA1());
rdb1.setText(currentQ1.getOPTB1());
rdc1.setText(currentQ1.getOPTC1());
rdd1.setText(currentQ1.getOPTD1());
if (ctr1 < 10)
qstnNo.setText("0" + ctr1 + "/30");
else
qstnNo.setText("" + ctr1 + "/30");
ctr1++;
}
@Override
public void onBackPressed() {
//super.onBackPressed();
AlertDialog.Builder builder = new AlertDialog.Builder(this);
//Uncomment the below code to Set the message and title from the strings.xml file
//builder.setMessage(R.string.dialog_message) .setTitle(R.string.dialog_title);
//Setting message manually and performing action on button click
builder.setMessage("Are you sure you want to close the quiz? Your progress will not be saved")
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
finish();
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// Action for 'NO' Button
dialog.cancel();
}
});
//Creating dialog box
AlertDialog alert = builder.create();
//Setting the title manually
alert.show();
}
public class CounterClass extends CountDownTimer {
public CounterClass(long millisInFuture, long countDownInterval) {
super(millisInFuture, countDownInterval);
}
@Override
public void onTick(long millisUntilFinished) {
long millis = millisUntilFinished;
String hms = String.format("%02d:%02d",
TimeUnit.MILLISECONDS.toMinutes(millis) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(millis)),
TimeUnit.MILLISECONDS.toSeconds(millis) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis)));
textViewTime1.setText(hms);
}
@Override
public void onFinish() {
showResult();
}
}
}
DbHelper -设置SQLite数据库
package com.example.hp.demo.DbHelper;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import com.example.hp.demo.Model.QuestionBasics;
import com.example.hp.demo.Model.QuestionChords;
import com.example.hp.demo.Model.QuestionScales;
import java.util.ArrayList;
import java.util.List;
public class DatabaseHelper extends SQLiteOpenHelper {
private static final String DATABASE_NAME = "Quiz.db";
public static final String TABLE_SCORE = "score";
public static final String SCORE_KEY_ID = "id";
public static final String SCORE_KEY_SECTION = "section";
public static final String SCORE_KEY_CAT = "category";
public static final String SCORE_KEY_SCORE = "score";
private static final String KEY_ID = "id";
private static final String KEY_QUES = "question";
private static final String KEY_ANSWER = "answer"; //correct option
private static final String KEY_OPTA = "opta"; //option a
private static final String KEY_OPTB = "optb"; //option b
private static final String KEY_OPTC = "optc"; //option c
private static final String KEY_OPTD = "optd"; //option d
private static final String KEY_CAT = "category"; //category
private static final String TABLE_QUEST = "questScales";
private static final String TABLE_QUEST1 = "questBasics";
private static final String TABLE_QUEST2 = "questChords";
private SQLiteDatabase dbase;
public DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, 1);
}
// public DatabaseHelper(Context context, String name,
//SQLiteDatabase.CursorFactory factory, int version) {
// super(context, DATABASE_NAME, factory, version);
// }
@Override
public void onCreate(SQLiteDatabase db) {
dbase = db;
String scalesTableCreate = "CREATE TABLE IF NOT EXISTS " + TABLE_QUEST + " ( "
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + KEY_QUES
+ " TEXT, " + KEY_ANSWER + " TEXT, " + KEY_OPTA + " TEXT, "
+ KEY_OPTB + " TEXT, " + KEY_OPTC + " TEXT, " + KEY_OPTD + " TEXT, " + KEY_CAT + " TEXT)";
db.execSQL(scalesTableCreate);
addQuestionsScales();
String basicsTableCreate = "CREATE TABLE IF NOT EXISTS " + TABLE_QUEST1 + " ( "
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + KEY_QUES
+ " TEXT, " + KEY_ANSWER + " TEXT, " + KEY_OPTA + " TEXT, "
+ KEY_OPTB + " TEXT, " + KEY_OPTC + " TEXT, " + KEY_OPTD + " TEXT, " + KEY_CAT + " TEXT)";
dbase.execSQL(basicsTableCreate);
this.addQuestionsBasics();
String chordsTableCreate = "CREATE TABLE IF NOT EXISTS " + TABLE_QUEST2 + " ( "
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + KEY_QUES
+ " TEXT, " + KEY_ANSWER + " TEXT, " + KEY_OPTA + " TEXT, "
+ KEY_OPTB + " TEXT, " + KEY_OPTC + " TEXT, " + KEY_OPTD + " TEXT, " + KEY_CAT + " TEXT)";
db.execSQL(chordsTableCreate);
addQuestionsChords();
String scoresTableCreate = "CREATE TABLE IF NOT EXISTS " + TABLE_SCORE + " ( "
+ SCORE_KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + SCORE_KEY_SECTION
+ " TEXT, " + SCORE_KEY_CAT + " TEXT, " + SCORE_KEY_SCORE + " INTEGER)";
db.execSQL(scoresTableCreate);
}
private void addQuestionsBasics() {
QuestionBasics q101 = new QuestionBasics("What is pitch?", "The length of a sound", "The overall quality of a sound", "The highness or lowness of a sound", "The volume of a sound", "The highness or lowness of a sound", "B");
this.addQuestionBasics(q101);
QuestionBasics q102 = new QuestionBasics("What is 'timbre'?", "The ove", "format it", "compile it", "hardware it", "format it", "B");
this.addQuestionBasics(q102);
QuestionBasics q103 = new QuestionBasics("What is rhythm?", "The sound a metronome makes", "The organisation of music through time", "A beat that repeats itself", "The amount of beats in a bar", "The organisation of music through time", "B");
this.addQuestionBasics(q103);
QuestionBasics q104 = new QuestionBasics("What is harmony?", "A series of pitches creating a musical statement", "The result of multiple notes played simultaneously", "A strong match between 2 different notes", "The sound a chord makes when the notes are in the correct key", "A strong match between 2 different notes", "B");
this.addQuestionBasics(q104);
QuestionBasics q105 = new QuestionBasics("What is a 'melody'?", "A strong rhythm that keeps the tune going", "A series of pitches that form a musical statement", "A set of chords that works well together", "A short motif to transition 2 sections of a song", "A series of pitches that form a musical statement", "B");
addQuestionBasics(q105);
QuestionBasics q106 = new QuestionBasics("What is 'dynamics'?", "Changes in textures, such as switching instruments", "Variations in loudness and softness", "The movement of music between different keys", "The way the melody of a song integrates with the chords", "Variations in loudness and softness", "B");
addQuestionBasics(q106);
QuestionBasics q107 = new QuestionBasics("What two note note pairs have no sharp or flat between them?", "DE, AB", "DF, BC", "BC ,DE", "EF, BC", "EF, BC", "B");
addQuestionBasics(q107);
}
public void addQuestionBasics(QuestionBasics quest) {
SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(KEY_QUES, quest.getQUESTION1());
contentValues.put(KEY_ANSWER, quest.getANSWER1());
contentValues.put(KEY_OPTA, quest.getOPTA1());
contentValues.put(KEY_OPTB, quest.getOPTB1());
contentValues.put(KEY_OPTC, quest.getOPTC1());
contentValues.put(KEY_OPTD, quest.getOPTD1());
contentValues.put(KEY_CAT, quest.getCATEGORY1());
// Inserting Row
dbase.insert(TABLE_QUEST1, null, contentValues);
}
private void addQuestionsScales() {
QuestionScales q1 = new QuestionScales("What is pitch ?", "The length of a sound", "The overall quality of a sound", "The highness or lowness of a sound", "The volume of a sound", "The highness or lowness of a sound", "B");
this.addQuestionScales(q1);
}
public void addQuestionScales(QuestionScales quest) {
//SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(KEY_QUES, quest.getQUESTION());
contentValues.put(KEY_ANSWER, quest.getANSWER());
contentValues.put(KEY_OPTA, quest.getOPTA());
contentValues.put(KEY_OPTB, quest.getOPTB());
contentValues.put(KEY_OPTC, quest.getOPTC());
contentValues.put(KEY_OPTD, quest.getOPTD());
contentValues.put(KEY_CAT, quest.getCATEGORY());
// Inserting Row
dbase.insert(TABLE_QUEST, null, contentValues);
}
private void addQuestionsChords() {
QuestionChords q1 = new QuestionChords("What is pitch ?", "The length of a sound", "The overall quality of a sound", "The highness or lowness of a sound", "The volume of a sound", "The highness or lowness of a sound", "B");
this.addQuestionChords(q1);
}
public void addQuestionChords(QuestionChords quest) {
//SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(KEY_QUES, quest.getQUESTION2());
contentValues.put(KEY_ANSWER, quest.getANSWER2());
contentValues.put(KEY_OPTA, quest.getOPTA2());
contentValues.put(KEY_OPTB, quest.getOPTB2());
contentValues.put(KEY_OPTC, quest.getOPTC2());
contentValues.put(KEY_OPTD, quest.getOPTD2());
contentValues.put(KEY_CAT, quest.getCATEGORY2());
// Inserting Row
dbase.insert(TABLE_QUEST2, null, contentValues);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_QUEST1);
onCreate(db);
}
public List<QuestionBasics> getAllQuestions1(String tname, String lname) {
List<QuestionBasics> quesList1 = new ArrayList<QuestionBasics>();
String selectQuery1 = "SELECT * FROM " + tname + " WHERE " + KEY_CAT + " = '" + lname + "'";
dbase = this.getReadableDatabase();
Cursor cursor = dbase.rawQuery(selectQuery1, null);
// looping through all rows and adding to list
if (cursor.moveToFirst()) {
do {
QuestionBasics quest1 = new QuestionBasics();
quest1.setID1(cursor.getInt(0));
quest1.setQUESTION1(cursor.getString(1));
quest1.setANSWER1(cursor.getString(2));
quest1.setOPTA1(cursor.getString(3));
quest1.setOPTB1(cursor.getString(4));
quest1.setOPTC1(cursor.getString(5));
quest1.setOPTD1(cursor.getString(6));
quesList1.add(quest1);
} while (cursor.moveToNext());
}
// return quest list
return quesList1;
}
public List<QuestionScales> getAllQuestions(String tname, String lname) {
List<QuestionScales> quesList1 = new ArrayList<QuestionScales>();
String selectQuery1 = "SELECT * FROM " + tname + " WHERE " + KEY_CAT + " = '" + lname + "'";
dbase = this.getReadableDatabase();
Cursor cursor = dbase.rawQuery(selectQuery1, null);
// looping through all rows and adding to list
if (cursor.moveToFirst()) {
do {
QuestionScales quest1 = new QuestionScales();
quest1.setID(cursor.getInt(0));
quest1.setQUESTION(cursor.getString(1));
quest1.setANSWER(cursor.getString(2));
quest1.setOPTA(cursor.getString(3));
quest1.setOPTB(cursor.getString(4));
quest1.setOPTC(cursor.getString(5));
quest1.setOPTD(cursor.getString(6));
quesList1.add(quest1);
} while (cursor.moveToNext());
}
// return quest list
return quesList1;
}
public List<QuestionChords> getAllQuestions2(String tname, String lname) {
List<QuestionChords> quesList1 = new ArrayList<QuestionChords>();
String selectQuery1 = "SELECT * FROM " + tname + " WHERE " + KEY_CAT + " = '" + lname + "'";
dbase = this.getReadableDatabase();
Cursor cursor = dbase.rawQuery(selectQuery1, null);
// looping through all rows and adding to list
if (cursor.moveToFirst()) {
do {
QuestionChords quest1 = new QuestionChords();
quest1.setID2(cursor.getInt(0));
quest1.setQUESTION2(cursor.getString(1));
quest1.setANSWER2(cursor.getString(2));
quest1.setOPTA2(cursor.getString(3));
quest1.setOPTB2(cursor.getString(4));
quest1.setOPTC2(cursor.getString(5));
quest1.setOPTD2(cursor.getString(6));
quesList1.add(quest1);
} while (cursor.moveToNext());
}
// return quest list
return quesList1;
}
public boolean insertScoreBasics(int scoreBasics, String tname, String cname) {
SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(SCORE_KEY_SECTION, tname);
contentValues.put(SCORE_KEY_CAT, cname);
contentValues.put(SCORE_KEY_SCORE, scoreBasics);
long resultscore = db.insert(TABLE_SCORE, null, contentValues);
return resultscore != -1;
}
public boolean insertScoreScales(int scoreScales, String tname, String cname) {
SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(SCORE_KEY_SECTION, tname);
contentValues.put(SCORE_KEY_CAT, cname);
contentValues.put(SCORE_KEY_SCORE, scoreScales);
long resultscore = db.insert(TABLE_SCORE, null, contentValues);
return resultscore != -1;
}
public boolean insertScoreChords(int scoreChords, String tname, String cname) {
SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(SCORE_KEY_SECTION, tname);
contentValues.put(SCORE_KEY_CAT, cname);
contentValues.put(SCORE_KEY_SCORE, scoreChords);
long resultscore = db.insert(TABLE_SCORE, null, contentValues);
return resultscore != -1;
}
public int getScoreBasics() {
Cursor c;
SQLiteDatabase db = this.getWritableDatabase();
String sqlSelectQuery = "SELECT MAX(" + SCORE_KEY_SCORE + ") FROM " + TABLE_SCORE + " WHERE " + SCORE_KEY_SECTION + " = '" + TABLE_QUEST1 + "' AND " + SCORE_KEY_CAT + " = " + "'I'";
c = db.rawQuery(sqlSelectQuery, null);
c.moveToFirst();
int x = c.getInt(0);
return x;
}
public int getScoreScales() {
Cursor c;
SQLiteDatabase db = this.getWritableDatabase();
String sqlSelectQuery = "SELECT MAX(" + SCORE_KEY_SCORE + ") FROM " + TABLE_SCORE + " WHERE " + SCORE_KEY_SECTION + " = '" + TABLE_QUEST + "' AND " + SCORE_KEY_CAT + " = " + "'I'";
c = db.rawQuery(sqlSelectQuery, null);
c.moveToFirst();
int x = c.getInt(0);
return x;
}
public int getScoreChords() {
Cursor c;
SQLiteDatabase db = this.getWritableDatabase();
String sqlSelectQuery = "SELECT MAX(" + SCORE_KEY_SCORE + ") FROM " + TABLE_SCORE + " WHERE " + SCORE_KEY_SECTION + " = '" + TABLE_QUEST2 + "' AND " + SCORE_KEY_CAT + " = " + "'I'";
c = db.rawQuery(sqlSelectQuery, null);
c.moveToFirst();
int x = c.getInt(0);
return x;
}
public Integer deleteData(String id) {
SQLiteDatabase db = this.getWritableDatabase();
return db.delete(TABLE_QUEST1, "ID = ?", new String[]{id});
}
}