The final code which worked is I added this.getcontext() in my view,
PinchZoomPanActivity2.tapped(this.getContext(), 100);
and in activity as follows
static void tapped(Context context, int requestCode){
((Activity) context).startActivityForResult(new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI), 1);
}