Using static methods in Android?
I already made some Apps in Android and noticed that I am often using static methods. For example I have an Class which extends PreferenceFragment . In this PreferenceFragment I set an onClick event on a Button . Button btn = new Button(getActivity().getApplicationContext()); btn.setText("Save"); v.addView(btn); btn.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { SettingsActivity.finishActivityWithResultOkey(); } }); Then I'm calling a static method in my SettingsActivity which finishes this Activity . Is this a good way of doing what I want to do? Or is there a