Trying to take an Array position(toString) and pass that to a new activity, then use that string to select which array to open in the new activity.
Intent launchingIntent = getIntent();
String content = launchingIntent.getData().toString();
setListAdapter(ArrayAdapter.createFromResource(getApplicationContext(), R.array.????, R.layout.main)); `
the R.array.???? needs to be the string that is passed (string content), because that is the name of my array to follow up with.
I can’t find a way to pass the string variable to the name of the array to use.
EDIT: Im trying to get one listView to open up another Listview in the same actvity, closing the prior one.
Use the
getIdentifier()method:I would advise against this because you lose the back button functionality(which may confuse the user). Instead use different activities passing relevant data with
Intentsor use fragments(especiallyListFragments).