How can you access variables content in
public class Global extends Application {
String gotUsername;
String gotPassword;
String gotIPAddress;
void onStartCommand(Intent intent){
Bundle gotAuthen = intent.getExtras();
gotUsername = gotAuthen.getString("key1");
gotPassword = gotAuthen.getString("key2");
gotIPAddress = gotAuthen.getString("key3");
}
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate();
}
}
from a Public class like this one?
Public Class MyApp {
}
I tried with
Global Username = (Global) getApplicationContext();
but I found out getApplicationContext();
is used for Activities only.
How should I do it then?
Thanks for your help!