変数コンテンツにアクセスするにはどうすればよいですか
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();
}
}
このようなパブリッククラスから?
Public Class MyApp {
}
で試しました
Global Username = (Global) getApplicationContext();
getApplicationContext();
しかし、アクティビティのみに使用されることがわかりました。
ではどうすればいいのでしょうか?
ご協力いただきありがとうございます!