Skip to content

Instantly share code, notes, and snippets.

first-hero

Block or report user

Report or block first-hero

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@udacityandroid
udacityandroid / Method 1
Last active Nov 1, 2019
Android Development for Beginners : Define a Method
View Method 1
private String createCalendarEventReminder(String eventName, String location, int minutesAway) {
String reminder = "You have an upcoming event in " + minutesAway + " minutes.";
reminder = reminder + " It is " + eventName + " held at " + location + ".";
return reminder;
}
View New method in MainActivity.java
/**
* This method displays the given text on the screen.
*/
private void displayMessage(String message) {
TextView priceTextView = (TextView) findViewById(R.id.price_text_view);
priceTextView.setText(message);
}
You can’t perform that action at this time.