I have an Activity where I want to show my received date from a Database. Showing my result in a TextView, that's no problem. But I also want to save my received Data in an String value. My Code: Main Activity:
db3 = new DatabaseC529(C529chooseActivity.this,tvC529Cthirdoccupied,tInt3);
db3.execute(methode, date, timeId3);
DatabaseC529: Constructor:
public DatabaseC529(Activity activity, TextView textView, String myValue){
this.activity = activity;
this.ctx = activity;
this.textView = textView;
this.myValue = myValue;}
...
protected void onPostExecute(String result) {super.onPostExecute(result);
this.textView.setText(result);
this.myValue = result;
}
After AsyncTask is completed, the Result is shown in the TextView. But I also want to have the Value stored in my String "tInt3". I created a button (just to check if the Value is stored) to get the content of tInt3 after AsyncTask is completed, but it always shows "null". Code Button:
public void button1 (View view){if(view.getId() == R.id.button1){
Toast.makeText(this, " " +tInt3, Toast.LENGTH_SHORT).show();
}
Can somebody please help me???