CursorAdapter v BaseAdapter

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

CursorAdapter v BaseAdapter

Postby Exeter » Wed Dec 23, 2009 6:25 pm

The class CursorGridAdapter is invoked on my MAIN Activity,

GridView gridview = (GridView) findViewById(R.id.gridview);
gridview.setAdapter(new CursorGridAdapter(this));

...producing the following error:

"cannot find symbol
symbol: Constructor CursorGridAdapter(org.me.IconView)
location: class.org.me.iconview.CursorGridAdapter"


Java class declaration:

public class CursorGridAdapter extends CursorAdapter{
public CursorGridAdapter(Context mContext, Cursor cursor) {
super(mContext, cursor);
}


This code works for classes extending BaseAdapter

Is there another way to reference a CursorAdapter class?
Exeter
Junior Developer
Junior Developer
 
Posts: 18
Joined: Tue Dec 22, 2009 4:17 pm

Top

<Include></Include>

Postby Exeter » Wed Dec 23, 2009 10:18 pm

I reverted the class CursorGridAdapter back to BaseAdapter with a cursor instead of an Integer Array.

Cursor cursor = fetch(blah blah blah);

imageview.setImageResource( cursor.getColumnIndex(KEY_SQUAREICON));
return imageview;


It seems to check out.

However, I need to debug my database in order to know for sure.



??? Is there a way of referencing Static Variables / Methods from a single DBAdapter class ???

...I was thinking of of putting Static Variables in Resources but I don't know the security implications.
In PHP this is accomplished with <Include></Include>

Any assistance would greatly speed up debugging! :)


Cheers,


Exeter
Exeter
Junior Developer
Junior Developer
 
Posts: 18
Joined: Tue Dec 22, 2009 4:17 pm

re: Global Variables / Methods

Postby Exeter » Wed Dec 23, 2009 11:02 pm

aha! extends Application does this.


Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public class DBAdapter extends Application{
Parsed in 0.029 seconds, using GeSHi 1.0.8.4





Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public class IconView extends Activity {
  2.  
  3.  
  4.  
  5. String Test = DBAdapter.KEY_PLAYERNAME;
  6.  
  7.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
Exeter
Junior Developer
Junior Developer
 
Posts: 18
Joined: Tue Dec 22, 2009 4:17 pm

Postby Exeter » Wed Dec 23, 2009 11:19 pm

And also, decaring a public Interface : Constants



http://www.anddev.org/viewtopic.php?p=3246
Exeter
Junior Developer
Junior Developer
 
Posts: 18
Joined: Tue Dec 22, 2009 4:17 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 6 guests