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(
I am doing alarm Project,
I want to set one time alarm..
I'm try to make a google calender service.
This is my code about calender.
if(android.os.Build.VERSION.SDK_INT >= 14)
{
LogShow("14");
final String[] COLS = new String[] {
CalendarContract.Events.TITLE,
CalendarContract.Events.DTSTART,
CalendarContract.Events.DTEND,
CalendarContract.Events.EVENT_LOCATION
I am trying to add events to a user's calendar programatically. I have followed countless guides here on StackOverflow and elsewhere, but none of them will make that damned event show up in my calendar.
The link "Delete calendar entries" solved my problem deleting all entries in the calendar.
Take a look at the code:
Cursor cursor;
cursor = resolver.query(eventsUri, new String[]{ "_id" }, "calendar_id=" + calendarId, null, null);
while(cursor.moveToNext()) {
long eventId = cursor.getLong(cursor.getColumnIndex("_id"));
resolver.delete(ContentUris.withAppendedId(eventsUri, eventId)
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()
I want to choose a random data from database and display in textview.
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(