I have an Android project with more that 50 global variables and I would like to collapse them so that the project is cleaner.
Is there a way to do that?
This:
public class MainActivity extends Activity {
private TextView texView1;
private int value1;
...
x50
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
to this:
public class MainActivity extends Activity {
globalVariables();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
private void globalVariables() {
private TextView texView1;
private int value1;
...
x50
}
}