Problem in baseadapter...please help

by scorpio » Thu, 22 May 2008 06:37:44 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. nexus one kernel not running on sdk emulator ?

Hi all


is there anyone have successful experience getting nexus 1 kernel
running on top of the emulator coming with the SDK 2.1?

I can not even bootstrap the kernel , I mean I didnt see something
like the following as what I did on goldfish kernel

Uncompressing
Linux.....................................................................................
done, booting the kernel.
Linux version 2.6.27-00110-g132305e (r...@dsl) (gcc version 4.2.1) #10
Fri Dec 4 15:11:36 EST 2009
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00093177
Machine: Goldfish
Memory policy: ECC disabled, Data cache writeback
CPU0: D VIVT write-through cache
CPU0: I cache: 4096 bytes, associativity 4, 32 byte lines, 32 sets
CPU0: D cache: 65536 bytes, associativity 4, 32 byte lines, 512 sets
Built 1 zonelists in Zone order, mobility grouping on.  Total pages:
24384
Kernel command line: qemu=1 console=ttyS0 android.checkjni=1
android.qemud=ttyS1 android.ndns=3
Unknown boot option `android.checkjni=1': ignoring



I noticed that for nexus one's mahimahi kernel, the CPU is
 CONFIG_CPU_32=y
 243 CONFIG_CPU_32v6K=y
 244 CONFIG_CPU_V7=y
 245 CONFIG_CPU_32v7=y
 246 CONFIG_CPU_ABRT_EV7=y
 247 CONFIG_CPU_PABRT_IFAR=y
 248 CONFIG_CPU_CACHE_V7=y
 249 CONFIG_CPU_CACHE_VIPT=y
 250 CONFIG_CPU_COPY_V6=y
 251 CONFIG_CPU_TLB_V7=y
 252 CONFIG_VERIFY_PERMISSION_FAULT=y
 253 CONFIG_CPU_HAS_ASID=y
 254 CONFIG_CPU_CP15=y
 255 CONFIG_CPU_CP15_MMU=y

which is difference from goldfish's ARM V5 configuration.


does the emulator support ARM V7 based kernel yet? Anyone had similar
experence or solution?

Thank you




-- 

2. How to set http proxy on Android Emulator

Dear all Android Emulator

  I'm developing android application in my university that must use
the internet through proxy server. In Android SDK 1.5 I use parameter -
http-proxy when starting emulator and it working. But since Android
SDK 1.6 until now (2.1) this approach is not working. I don't know hot
to fix this problem.

  Do you have any solutions?

 best regard.

?:-)

3. Black Screen on using SetVisibility

4. "Debug certificate expired" error in eclipse android plugins

5. Is it possible to use Android NDK under MingGW?

6. Regarding relative layout problem

7. Problem about adding app widget into my application(custom home screen)