Android use of an string array on another method
- by spagi
Hi all.
Im trying to make an activity that has a multiple choice dialog after you push a button. In there you select from a list of things. But these things are received from a web method before the dialog appears.
So I create a string array after I receive them inside the onCreate to initialise it there with the correct size.
But my dialog method then cant get the array because propably its out of its scope.
My code looks like this
@Override
protected Dialog onCreateDialog(int id)
//Here is where the array is loaded to the multiple select dialog
etc
@Override
public void onCreate(Bundle savedInstanceState)
//Here is where i initialise the array and get its contents
etc
I cant initialise my array when the class starts because I dont know its size yet.
This has to do something with the scopes of my variables and I am pretty confused