I have created other class for global variables now I just want to cast it like that:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity1);
class2 global;
global = (class2)getApplicationContext();
I get error:
android.app.Application cannot be cast to eu.tools.test_training_home.class2
The class2
:
public class class2 extends Application {
private String name="name1";
private int number =0;