• 12

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191


File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

I have a problem, when I startActivityForResult to take picure, resultCode is always Activity.RESULT_CANCELED (0) if there is two or more camera apps that can handle that intent (app chooser appears). But if I set one of them as default app and next time it doesn't offer me a chooser, everything works fine, and it takes picture and detects it in a onActivityResult in my fragment that started startActivityForResult(). Same thing happens when I try to open gallery to select picture. If there are two gallery apps, I choose either one of them, picture selection result is always 0. This is the code I use to start camera app:

Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
 if (takePictureIntent.resolveActivity(getActivity().getPackageManager()) != null) {
      startActivityForResult(takePictureIntent, AppConstants.TAKE_PICURE_CAMERA_REQUEST_CODE);