package com.samovich.funfacts;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;

// Layout: http://treehouse-code-samples.s3.amazonaws.com/Android/fun_facts_mockups.png
// Colors: http://treehouse-code-samples.s3.amazonaws.com/Android/fun_facts_colors.html

public class FunFactsActivity extends AppCompatActivity {

    // View variables
    private TextView mFactTextView;
    private Button mShowFactButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fun_facts);
    }
}

@@ -100,16 +100,42 @@
 Bundle;%0A
+import android.view.View;%0A
 import a
@@ -156,16 +156,16 @@
 Button;%0A
-
 import a
@@ -189,16 +189,42 @@
 tView;%0A%0A
+import java.util.Random;%0A%0A
 // Layou
@@ -458,17 +458,25 @@
 %0A    // 
-V
+Declare v
 iew vari
@@ -669,16 +669,16 @@
 State);%0A
-
         
@@ -721,16 +721,1793 @@
 _facts);
+%0A%0A        // Assign the views from layout file to the corresponding variables%0A        mFactTextView = (TextView) findViewById(R.id.factTextView);%0A        mShowFactButton = (Button) findViewById(R.id.showFactButton);%0A%0A        View.OnClickListener listener = new View.OnClickListener() %7B%0A            @Override%0A            public void onClick(View v) %7B%0A                String%5B%5D facts = %7B%0A                        %22Ants stretch when they wake up in the morning.%22,%0A                        %22Ostriches can run faster than horses.%22,%0A                        %22Olympic gold medals are actually made mostly of silver.%22,%0A                        %22You are born with 300 bones; by the time you are an adult you will have 206.%22,%0A                        %22It takes about 8 minutes for light from the Sun to reach Earth.%22,%0A                        %22Some bamboo plants can grow almost a meter in just one day.%22,%0A                        %22The state of Florida is bigger than England.%22,%0A                        %22Some penguins can leap 2-3 meters out of the water.%22,%0A                        %22On average, it takes 66 days to form a new habit.%22,%0A                        %22Mammoths still walked the earth when the Great Pyramid was being built.%22 %7D;%0A%0A                // The button was clicked, and TextView update with a new fact%0A                String fact = %22%22;%0A%0A                // Randomly select a fact%0A                Random randomGenerator = new Random();%0A                int randomNumber = randomGenerator.nextInt(facts.length);%0A                // fact = randomNumber + %22%22;%0A                fact = facts%5BrandomNumber%5D;%0A%0A                // Update the screen with our dynamic fact%0A                mFactTextView.setText(fact);%0A            %7D%0A        %7D;%0A%0A        mShowFactButton.setOnClickListener(listener);
 %0A    %7D%0A%7D

Complete code for app