Code example for GridView

Methods: getAdaptersetAdaptersetNumColumns

0
	    Log.d(getClass().getSimpleName(), "multimedia url = " + multimedia);
	    image.setImageURI(Uri.parse(activeSurvey.getPath() + "/img/"
		    + multimedia));
	} 
 
	grid.setNumColumns(activeQuestion.getColumns());
	grid.setAdapter(new AnswersAdapter(activeQuestion, this));
 
	SQLiteDatabase db = mDbHelper.getReadableDatabase();
	Cursor cursor = db.rawQuery(
		"select answer_value from survey_answers where survey_id = " 
			+ activeSurvey.surveyID + " and question_id = ?", null);
	if (cursor.getCount() > 0) {
	    db.close();
	    String result = cursor.getString(0);
	    ((AnswersAdapter) grid.getAdapter()).setResult(result);
	} else { 
	    db.close();
	    db = mDbHelper.getWritableDatabase();
	    db.execSQL("insert into survey_answers (survey_id, question_id, answer_value) values ("
		    + activeSurvey.surveyID