import android.widget.TextView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Retrieve the content view that renders the map.
setContentView(R.layout.activity_maps);
// Add title
getSupportActionBar().setTitle("Event Details");
// Add Back button
android.support.v7.app.ActionBar actionBar = getSupportActionBar();
if(actionBar != null){
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
}
// Get intent
Intent intename = getIntent();
// nameString = (String) intename.getSerializableExtra("NAME");
// timeString = (String) intename.getSerializableExtra("TIME");
nameString = "lalala";
timeString = "24:00";
descriptionString = (String) intename.getSerializableExtra("PostText");
lat = (double) intename.getSerializableExtra("LAT");
lng = (double) intename.getSerializableExtra("LNG");
// zipcodeString = (String) intename.getSerializableExtra("ZIPCODE");
// addressString = (String) intename.getSerializableExtra("ADDRESS");
zipcodeString = "02215";
addressString = "PHO";
location = new LatLng(lat, lng);
// Get the SupportMapFragment and request notification
// when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
// Get TextView
name = (TextView) findViewById(R.id.Name);
time = (TextView) findViewById(R.id.Time);
description = (TextView) findViewById(R.id.Description);
// Get Button
mapAppCtrl = (Button) findViewById(R.id.openMap);
mapAppCtrl.setOnClickListener(new MapsMarkerActivity.ButtonClickHandler());
// Set TextView uneditable
name.setKeyListener(null);
time.setKeyListener(null);
description.setKeyListener(null);
// Set TextView size and bold
name.setTextSize(20);
time.setTextSize(10);
TextPaint paint = name.getPaint();
paint.setFakeBoldText(true);
//Set content
name.setText(nameString);
time.setText(timeString);
description.setText(String.format("%s\n%s\n%s", descriptionString, addressString, zipcodeString));
}