I have a method leftup which has an onClick listener from a button. The purpose of method leftup is to do the following:
- Get an array from resources xml (Which contains names of my other activities)
- Turn array into an array list
- Remove a string from that array (The current class name)
- Convert the list back into an array
- Get a random value from that array
- Execute method goToActivity with parameter of that random value
I have spent hours on this task so far, because the logic of the code seems fine. The problem is, when I run the code, I get the infamous error:
Unfortunately, "App_Name" has stopped
Here is my code for method onClick and goToActivity:
Here is my array in the resources:
By the way, string activity state is the name of the activity :
I am sure the exception is in the method leftup, as none of the Toasts get executed, and the error happens immediately as I click on the button.
Thank you so much for all your help, I really appreciate it.
A fellow programmer,
{Rich}
Stack trace:
https://gist.github.com/anonymous/dcd63f51289aaf1a1933
Here is the stack trace because I couldn't format it, this is the git hub page.