Basically I have a method that populates a listview from my database.
I am receiving both null pointers on a cursor and 'unable to stop activity' errors.
This is how I am returning my cursor:
public Cursor getAppointmentsData() {
String[] columns = new String[] { KEY_ROWAPPID, KEY_NAMEAPP,
KEY_TYPEAPP, KEY_TIMEAPP, KEY_DATEAPP, KEY_COMMENTAPP };
Cursor c = ourDatabase.query(
The follow statement give me cursor.moveToNexe() == false. Does anyone know what is the matter? Many thanks.
I am able to select one contact and get its respective phone number.
code:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
if (requestCode == PICK_CONTACT_REQUEST) {
if (resultCode == RESULT_OK) {
Uri contactUri = data.getData();
String[] projection = { Phone.NUMBER };
Cursor cursor = getContentResolver()
Uri selectedVideo = intent.getData();
String[] filePathColumn = { MediaStore.Video.VideoColumns.DATA,
MediaStore.Video.VideoColumns.DURATION,
MediaStore.Video.VideoColumns.SIZE,
MediaStore.Video.VideoColumns.DATE_TAKEN};
Cursor cursor = getContentResolver().query(selectedVideo,
I'm working on dictionary database, I insert the query when the activity is first launch, it works smoothly, and at the next launch I want to prevent the insertion for the second time, I use this method to prevent insertion by checking whether the row is null or not, but it always rise a java null pointer exception in my logcat.
public boolean isEmpty()
{
boolean empty = false;
Cursor cur
I want to upload image, audio and video files from my app.
I had query title column from database and want to set it in TextView in GridView.
How?
CafeDatasource
public List<Model_Insert> findTblCafe(){
List<Model_Insert> model_Inserts = new ArrayList<Model_Insert>();
Cursor cursor = database.query(CafeDbOpenHelper.TABLE_CAFE, rtv_tbl_Cafe,
null, null, null, null, null);
Log.i("number", "return" + cursor.getCo
I'm trying to read from a SQLite database using the following code:
public List<DBEntry> getAllDBEntrys() {
List<DBEntry> DBEntrys = new ArrayList<DBEntry>();
Cursor cursor = database.query(DatabaseClass.TABLE_APPTS,
allColumns, null, null, null, null, null);
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
DBEntry DBEntry = cursorToDBEntry(
How can I use AWK in the following situation?
I want to concatenate lines that start with the same column.