I am still new to Android Development, I am trying to design an app which will retrieve information from a postgreSQL DB and display in a readable view, preferable grouped together in tabs of related content, for example: the app retrieves information about a holiday one tab should be information regarding flight details, another about hotel details, another about payment details etc..
The user should enter there booking id, hit a button and the information should be collected and displayed. I have this much working minus the manner in which the information is displayed
I cannot figure out how to edit the view the information is displayed in, see my code below:
Code:
public class **** extends Activity {
/** Called when the activity is first created. */
TextView resultArea;
private Button enterBookingRefBtn;
protected EditText enterRef;
String bookingRefNum;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
resultArea = new TextView(this);
resultArea.setText("Please Wait");
setContentView(layout.main);
this.enterBookingRefBtn = (Button)this.findViewById(R.id.enterBookingRefButton);
this.enterBookingRefBtn.setOnClickListener(new OnClickListener(){
public void onClick(View v) {
final EditText enterRef = (EditText) findViewById(R.id.enterRef);
bookingRefNum = enterRef.getText().toString();
// I CANT FIGURE OUT HOW TO EDIT THE BELOW VIEW
setContentView(resultArea);
// I CANT FIGURE OUT HOW TO EDIT THE ABOVE VIEW
new FetchSQL().execute();
}
});
}
So the information is displayed by the setContentView(resultArea), and I cant find anyway to edit this, I would like to add a back button, and edit how the information is displayed, but im just stuck, any changes I have cause the app to crash..
ANY HELP IS VERY MUCH APPRECIATED