EventDetailsScreen.java 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package com.example.yiupang.freefoodfinder;
  2. import android.os.Bundle;
  3. import android.widget.TextView;
  4. import android.support.v7.app.AppCompatActivity;
  5. public class EventDetailsScreen extends AppCompatActivity
  6. {
  7. @Override
  8. protected void onCreate(Bundle savedInstanceState)
  9. {
  10. super.onCreate(savedInstanceState);
  11. setContentView(R.layout.activity_event_details_screen);
  12. String selectedEventName = (String)getIntent().getExtras().getSerializable("selectedEventName");
  13. String selectedEventTime = (String)getIntent().getExtras().getSerializable("selectedEventTime");
  14. String selectedEventPlace = (String)getIntent().getExtras().getSerializable("selectedEventPlace");
  15. String selectedEventDesc = (String)getIntent().getExtras().getSerializable("selectedEventDesc");
  16. String selectedEventFoodType = (String)getIntent().getExtras().getSerializable("selectedEventFoodType");
  17. TextView nameText = (TextView) findViewById(R.id.nameText);
  18. nameText.setText(selectedEventName);
  19. TextView timeText = (TextView) findViewById(R.id.timeText);
  20. timeText.setText(selectedEventTime);
  21. TextView placeText = (TextView) findViewById(R.id.placeText);
  22. placeText.setText(selectedEventPlace);
  23. TextView foodText = (TextView) findViewById(R.id.foodText);
  24. foodText.setText(selectedEventFoodType);
  25. TextView descText = (TextView) findViewById( R.id.descText);
  26. descText.setText(selectedEventDesc);
  27. }
  28. }