Answer the question
In order to leave comments, you need to log in
How to pass a value from an array to a variable in another controller?
Help solve the problem. Activity1 has a string array whose values are displayed using the listview. You need to click to go to another activity and pass the value from the array to its class, to the variable. The transition is set up like this:
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int pos, long id) {
Intent intent = new Intent(MainActivity.this, PaletteActivity.class);
startActivity(intent);
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question