S
S
SkRus2021-01-04 12:24:19
Android
SkRus, 2021-01-04 12:24:19

How to set background programmatically in activity1 from activity2?

There is one Activity, in it I want to make a changing background on pressing a button from another activity. If you make a button in the same activity, everything works, but from another activity it does not work. how to pass simple data with putExtra and onActivityResult i know but how to pass data to LinerLayout? It is not necessary to write code, maybe someone will tell you the direction.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2021-01-04
@SkRus

No way. Activities should not call each other directly. Pass simple data (color) and change on the spot. In general, you should not have several activities in most cases. One fragment is enough.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question