Back to project page Fall_Prevention_2013.
The source code is released under:
Apache License
If you think the Android project Fall_Prevention_2013 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/******************************************************************************* * Licensed to UbiCollab.org under one or more contributor * license agreements. See the NOTICE file distributed * with this work for additional information regarding * copyright ownership. UbiCollab.org licenses this file * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance * with the License. You may obtain a copy of the License at * /*www . j av a2 s. c om*/ * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. ******************************************************************************/ package ntnu.stud.valens.demonstration.activity; import java.util.Map; import ntnu.stud.valens.demonstration.R; import ntnu.stud.valens.demonstration.connectivity.DatabaseContract; import ntnu.stud.valens.demonstration.connectivity.DatabaseHelper; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.TextView; /** * This class will provide more detailed information about the * Notifications/events form the event list */ public class EventDetail extends Activity { private int eventId; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_eventdetail); // Get the event type and ID from the intent Intent motherIntent = getIntent(); eventId = motherIntent .getIntExtra("no.ntnu.stud.fallprevention.ID", -1); // Fetch description and headline from database Map<String, String> eventInformation = new DatabaseHelper(this).dbGetEventInfo(eventId); // Fill in information TextView textView = (TextView) findViewById(R.id.headlineTextView); textView.setText(eventInformation.get(DatabaseContract.EventType.COLUMN_NAME_TITLE)); TextView textView2 = (TextView) findViewById(R.id.mainTextView); String mTempDesc = getString(R.string.event_desc_two_params); if(textView.getText().toString().equalsIgnoreCase(getString(R.string.event_list_warning_title))){ mTempDesc=getString(R.string.event_list_warning_description); }else{ mTempDesc=mTempDesc.replaceAll("%1", eventInformation.get(DatabaseContract.Event.COLUMN_NAME_PARAMETER_1)); mTempDesc=mTempDesc.replaceAll("%2", eventInformation.get(DatabaseContract.Event.COLUMN_NAME_PARAMETER_2)); mTempDesc=mTempDesc.replaceAll("null", getString(R.string.event_null_parameter)); } textView2.setText(mTempDesc); } /** * Fires an event to delete the event you are currently viewing Sends you * back to Eventlist afterwards. * * @param view */ public void fireDeleteButton(View view) { // Delete event from database new DatabaseHelper(this).dbDeleteEvent(eventId); // Then go back to EventList screen Intent intent = new Intent(this, EventList.class); startActivity(intent); } /** * Doesn't do anything to the Event Sends you back to the EventList * * @param view */ public void fireKeepButton(View view) { // Go back to EventList screen Intent intent = new Intent(this, EventList.class); startActivity(intent); } }