How to use SQLiteOpenHelper without or less restrictive use of Context?

Posted by Pentium10 on Stack Overflow See other posts from Stack Overflow or by Pentium10
Published on 2010-05-21T14:38:59Z Indexed on 2010/05/21 14:40 UTC
Read the original article Hit count: 191

Filed under:
|
|
|

If you extend SQLiteOpenHelper, for the Constructor you have to use a Context. I am wondering if there is a way to leave this out, and be able to work with database tables without a Context.

Or at least be least restrictive, I mean a way of project/class structure that will make history the several context passings I have to do now.

As it is my application has several level of classes, chained in each other, and there are a few that connects to the database, but have no whatsoever influence on the interface, so they don't actually need the Context.

Are you creating your classes in the way that you pass each time a Context to them?
If not, how you do, how you reuse a Context in a short class?

© Stack Overflow or respective owner

Related posts about java

Related posts about android