1

Database access from Listfragment class

view story
linux-howto

http://stackoverflow.com – I made three Java files in my program. They are MainActivity.java, TrackerDBAdaptor.java, and MyListFragment.java. To access the database I have private TrackerDBAdapter dbHelper; dbHelper = new TrackerDBAdapter(this); When I put the above lines in the MainActivity.java, no problem. But my intention is I'd like to access the database from my MyListFragment.java class. So I put these two lines inside the onCreateView() of the MyListFragment.java. Then "this" inside the dbHelper = new TrackerDBAdapter(this); has problem. What I understood is this means the instance of the class ca (HowTos)