Just started working with Android and immediately came across the problem: how to manage UI elements from other classes?

Example, I have a class (in fact, a stupid switch), which, depending on the data coming in, must perform various actions (add an item to the ListView, issue a notification, etc.) how to make it possible to manage the activity elements out of it, and is it wise?

If not, please tell me which method to work with the interface.

  • 2
    familiar with the patterns of MVP, MVVM, MVC? - Mikhail Vaysman
  • not really, and as I understand it, it's time to start learning ... - Heorhii Lysenko
  • and master the search. Try searching: the architecture of an android application. - Mikhail Vaysman
  • Oh, how abstruse, to communicate with the kernel :) developer.alexanderklimov.ru/android started with it, well acquainted with ui, with the basics, tezhe List. And so the question is not clear ... - Denis Kotlyarov
  • 2
    In Android, the classical scheme - interaction with the activation is built, as a rule, on callbacks (callback methods). At a certain event, the class sends a callback, an activity subscribed to this callback accepts it and interacts with the UI. As an example, the work of listeners to touch the buttons (OnClickListener callback) - pavlofff

0