what I am trying to do is create an array of strings that has 1000 or so entries. Instead of doing:
public void DefaultGeneric(View v) throws FileNotFoundException{
Random rand = new Random();
int i = rand.nextInt(4) + 0;
int j = rand.nextInt(4) + 0;
String[] SomeThingA = {"yep","okay","nope"}; //I need this array to be much much larger but want a better way of doing it.
String[] SomeThingB = {"test","test1","test2"}; //I need this array to be much much larger but want a better way of doing it.
Toast.makeText(getBaseContext(), SomeThingA[i]+SomeThingB[j], Toast.LENGTH_LONG ).show();
}
to declare my long array I've been researching how to create a .txt
file with all of the array values and then using arraylist. But every time I try it fails. In addition, once I figure out how to use arraylist I then need to use the:
Toast.makeText(getBaseContext(), variable, Toast.LENGTH_SHORT).show
to call out a specific row of my arraylist.
Any help will be gratefully appreciated. Thank you!