I want to create a class to handle everything to do with images for my application.
It made sense to extend SQLiteOpenHelper for to do this, since most of its work is done in a database.
One of my methods returns a ViewGroup object that I can incorporate in several higher-level layouts. This ViewGroup contains a group of pictures, and a button to add new images.
My problem comes when I want to handle the button click with a startActivityForResult() action – which is a part of the Activity class, and not available in the SQLiteOpenHelper class.
Am I approaching this wrong? Or is there a way I can access startActivityForResult() (and onActivityResult()) from within my class?
This appears to work by passing an Activity as a parameter to the class, and then using:
myActivity.startActivityForResult(…