-
-
Save jaenwawe/380d3540c9bc6850f27b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
android:paddingBottom="@dimen/activity_vertical_margin" | |
android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin" | |
tools:context=".MainActivity"> | |
<TextView | |
android:id="@+id/menu_item_1" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="Mango sorbet" | |
android:textAppearance="?android:textAppearanceMedium" /> | |
<TextView | |
android:id="@+id/menu_item_2" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="8dp" | |
android:text="Blueberry pie" | |
android:textAppearance="?android:textAppearanceMedium" | |
android:textSize="18sp" /> | |
<TextView | |
android:id="@+id/menu_item_3" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="8dp" | |
android:text="Chocolate lava cake" | |
android:textAppearance="?android:textAppearanceMedium" | |
android:textSize="18sp" /> | |
<Button | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="8dp" | |
android:onClick="printToLogs" | |
android:text="Print menu to logs" /> | |
</LinearLayout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.android.menu; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.View; | |
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
} | |
public void printToLogs(View view) { | |
// Find first menu item TextView and print the text to the logs | |
// Find second menu item TextView and print the text to the logs | |
// Find third menu item TextView and print the text to the logs | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment