Problem in baseadapter..please help

by scorpio » Thu, 22 May 2008 06:37:15 GMT


Sponsored Links
 i,

I tried to select an item from the list, but not getting somebody
please help. I struck here for a long time. Actually in this, i am
using Baseadapter. So How can i select. I tried with onItemClick, but
null pointer exception coming..


public class ListQuery extends ListActivity implements
OnItemClickListener {

SQLiteDatabase myDatabase = null;
int size = 20;
String[] iStuffarea = new String[size];
String[] iStuffage = new String[size];
String[] iStuffsex = new String[size];
String[] iStuffheight = new String[size];
String[] iStuffweight = new String[size];
String[] iStuffcity = new String[size];
String[] iStuffcountry = new String[size];
String[] uStuffarea = new String[size];
String[] uStuffage = new String[size];
String[] uStuffsex = new String[size];
String[] uStuffheight = new String[size];
String[] uStuffweight = new String[size];
String[] uStuffcity = new String[size];
String[] uStuffcountry = new String[size];
int count = 0;
ArrayList<String> results = new ArrayList<String>();

@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setListAdapter(new SpeechListAdapter(this));
getListView().setOnItemClickListener(this);
}

private class SpeechListAdapter extends BaseAdapter {

public SpeechListAdapter(Context context) {
mContext = context;

try {
myDatabase = mContext.openDatabase("Mobeegal", null);
String myCols[] = {"iStuffAge", "iStuffSex",
"iStuffHeight", "iStuffWeight", "iStuffArea", "iStuffCity",
"iStuffCountry"};
Cursor c = myDatabase.query(false, "IStuff", myCols,
null, null, null, null, null);

String myCols1[] = {"uStuffAgeRange", "uStuffSex",
"uStuffHeightRange", "uStuffWeightRange", "uStuffArea", "uStuffCity",
"uStuffCountry"};
Cursor c1 = myDatabase.query(false, "UStuff", myCols1,
null, null, null, null, null);

int uagecolumn = c1.getColumnIndex("uStuffAgeRange");
int usexcolumn = c1.getColumnIndex("uStuffSex");
int uheightcolumn =
c1.getColumnIndex("uStuffHeightRange");
int uweightcolumn =
c1.getColumnIndex("uStuffWeightRange");
int uareacolumn = c1.getColumnIndex("uStuffArea");
int ucitycolumn = c1.getColumnIndex("uStuffCity");
int ucountrycolumn =
c1.getColumnIndex("uStuffCountry");

int ageColumn = c.getColumnIndex("iStuffAge");
int sexColumn = c.getColumnIndex("iStuffSex");
int heightColumn = c.getColumnIndex("iStuffHeight");
int weightColumn = c.getColumnIndex("iStuffWeight");
int areaColumn = c.getColumnIndex("iStuffArea");
int cityColumn = c.getColumnIndex("iStuffCity");
int countryColumn = c.getColumnIndex("iStuffCountry");
if (c != null) {
count = 0;
if (c.first()) {
do {



Other Threads

1. Android Market crashes after tyring to update removed app.

Hi,

I installed an app on my phone, and after a while the Market App found
an update. I didn't update the app yet, but i removed the application.
No the Market App still wants to update the app, and when it tries to
do so it crashes. I tried reinstalling the app, but then the Market
App
also crashes (all other installs are fine). If i update an other
application manually it works fine. One more problem is that the auto
update
function (that generates the list for apps-to-update) places the
removed app at the top, and crashes immediately. So the total list of
apps-to-update
keeps growing and growing, unless i manually browse through all market
apps and update all manually.

How can i remove the failing app from the to-update list?

If this is the incorrect group for such a question, can you please
direct me to a correcter group for such type of questions...

-- 

2. [WTA] Play Video resolusi 1280x720

RR sekalian,

as subject,mau nanya nih.. kira2 handheld android dengan resolusi
800x480 bisa maenin file video resolusi 1280x720 ga ya?
kalo bisa gmn caranya? ambil aja contoh handheldnya DHD gtu.. :)

mohon bantuannya :)

-- 
===============
"

3. What Is The Best Way To Override Stock Lock Screen?

4. Possible to use the gallery "Share" menu

5. some question about Honeycomb

6. onDialogCreate - "The specified child already has a parent."

7. how to play video on Android?