Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Android button open dialogue of all sqlite row values based name in textview op

ID: 642394 • Letter: A

Question

Android button open dialogue of all sqlite row values based name in textview

op here---if timer runs out i will update/extend question time until i get working answer

Right now in the tabCustomers.java there is a autocomplete textbox and when you start to type a name into the box it searches the customer table in the sqlite database and then suggests what name you are typing then when you click on it places the name you clicked to the textview box. That part works great. Figure 1:

(link to gdrive has pics of figures)

Now I have another function in that same tabCustomers class that on longClick will store the cID of the customer clicked and open a dialogue box showing a menu with options that use that stored cID to displays all the details about that name selected/clicked.

What I want is for right after when you click the button

Explanation / Answer

package com.example.matik; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteOpenHelper; public class Veritabani extends SQLiteOpenHelper { private static final String VERITABANI="KAYISGDATA.db"; private static final int SURUM=1; public static final String TABLE_TODO = "nace"; public static final String COLUMN_ID = "_id"; public static final String COLUMN_CATEGORY = "KOD"; public static final String COLUMN_SUMMARY = "ACK"; public static final String COLUMN_DESCRIPTION = "TEH"; private static final String DB_DROP = "DROP TABLE IF EXISTS nace"; private static final String DATABASE_CREATE = "create table " + TABLE_TODO + "(" + COLUMN_ID + " integer primary key autoincrement, " + COLUMN_CATEGORY + " text not null, " + COLUMN_SUMMARY + " text not null," + COLUMN_DESCRIPTION + " text not null" + ");"; public Veritabani(Context con, String name, CursorFactory factory, int version) { super(con, VERITABANI, null, SURUM); // TODO Auto-generated constructor stub } @Override public void onCreate(SQLiteDatabase db) { // TODO Auto-generated method stub db.execSQL(DATABASE_CREATE); db.execSQL("INSERT INTO nace (KOD,ACK,TEH) VALUES('01.11.07','Baklagillerin yeti?tirilmesi','Tehlikeli')");} @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL(DB_DROP); onCreate(db); } }