S
S
Stanislav Korolevskiy2017-10-22 20:42:04
Android
Stanislav Korolevskiy, 2017-10-22 20:42:04

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);
            }
        });

I don't understand how to pass the value

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2017-10-22
@korolevsky_s

intent.put*/get*

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question