i have public class ExperimentAllInOneActivity extends Activity implements OnClickListener on each button click listener i want to go some other class like public class TemperatureStrategy and perform all logic calculation in this class but main thing is that i have class like public class DialogDisplay extends Dialog implements OnItemSelectedListener in this class a custom dialog is created. Now I have question is that on each button onclick listener I want to call(display) this custom dialog class in, spinner class and like that type of element, and all logic performed with class TemperatureStrategy. How to build constor and pass context of all class?
i have public class ExperimentAllInOneActivity extends Activity implements OnClickListener on each button click listener
Share
you can do it in 2 ways AFAIK:
1. Add a
context argumentin your function like this:public static void display (Context context) {
// Do your action using action…
2. Add a
context argument to your class constructureand use this context in all your functions.