私がやろうとしているのは、子タブからアクセスできるJSONObjectを用意して、情報を入力できるようにすることだけです。
public class Example extends TabActivity{
private JSONObject testtt = new JSONObject();
public void writeJSON(String key, String value) throws JSONException {
testtt.put(key, value);
}
public String getJSON(){
return testtt.toString();
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.example);
//Creating the tabs and everything
//Is Here
}
}
タブの1つを前後にナビゲートするよりも、次へ/前へのボタンがあります。
public void onClick(View v) {
//Pre-alertDialog.setmessage stuff here.
alertDialog.setMessage(Example.this.getJSON());
// Example.this gives this error: No enclosing instance of the type Example is accessible in scope
}
私はたくさんの代替手段を試し、助けを求めるところまで来ました(私にとっては非常にまれです)。また、私がAndroid開発に比較的慣れていないこともおそらく明らかです。
編集:Class extendsApplication{を介してグローバル変数を試行する場合