- 
      
- 
        Save PowerImagination/4066ccb6924552b225688134ec6c0858 to your computer and use it in GitHub Desktop. 
Revisions
- 
        udacityandroid created this gist Jun 27, 2015 .There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ package com.example.android.menu; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.TextView; 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 TextView textViewItem1 = (TextView) findViewById(R.id.menu_item_1); String menuItem1 = textViewItem1.getText().toString(); Log.v("MainActivity", menuItem1); // Find second menu item TextView and print the text to the logs TextView textViewItem2 = (TextView) findViewById(R.id.menu_item_2); String menuItem2 = textViewItem2.getText().toString(); Log.v("MainActivity", menuItem2); // Find third menu item TextView and print the text to the logs TextView textViewItem3 = (TextView) findViewById(R.id.menu_item_3); String menuItem3 = textViewItem3.getText().toString(); Log.v("MainActivity", menuItem3); } } 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ <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> 
 udacityandroid
              created
            
            this gist
            
              udacityandroid
              created
            
            this gist