0

https://stackoverflow.com/a/2508138/1508448

Please go through the link above. My compiler is showing a problem in REQ_CODE_PICK_IMAGE. It asks if I need to create a variable. What is it?

Community
  • 1
  • 1
rrrocky
  • 696
  • 1
  • 11
  • 27
  • Create public final static int REQ_CODE_PICK_IMAGE=1; – Padma Kumar Jul 19 '12 at 13:43
  • "variable" in Java is a named piece of data on the stack that you can use in context of a scope. If you intend to write actual programs, You might want to read up on them, they are used quite often. – fdreger Jul 19 '12 at 13:45

1 Answers1

0

//you need to create an variable in your class

 public final static int REQ_CODE_PICK_IMAGE=1


switch(case)
case 1: //instead of hardcoding here you need to declare the variable as integer
break;
case 2;
 .
 .

EDIT:

When an activity exits, it can call setResult(int) to return data back to its parent. It must always supply a result code, which can be the standard results RESULT_CANCELED, RESULT_OK, or any custom values starting at RESULT_FIRST_USER. In addition, it can optionally return back an Intent containing any additional data it wants. All of this information appears back on the parent's Activity.onActivityResult(), along with the integer identifier it originally supplied.

Padma Kumar
  • 19,893
  • 17
  • 73
  • 130