Hello. Tell me how to transfer the value of a variable from MainActivity to View which is in a separate class.

    1 answer 1

    You write a method in the class of your view:

    public void setData(Data data); 

    then you call:

     final Data data = new Data(); myView.setData(data); 

    All, no magic.