title: Android Dev Beginner here, trying to make button display Obama's face on ImageView
body: <h2>So the problem is... I can't seem to find out why the image wont show up when I click the button.</h2>
  
  <p>Also found this in the logcat (if it means anything):</p>
  
  <pre><code>01-04 12:05:43.032 21338-21345/? E/art: Failed sending reply to debugger: Broken pipe
  </code></pre>
  
  <p>Here is content_main.xml </p>
  
  <pre><code>&lt;LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  android:paddingBottom="@dimen/activity_vertical_margin"
  
  app:layout_behavior="@string/appbar_scrolling_view_behavior"
  tools:showIn="@layout/activity_main"
  tools:context="com.example.dylan.secondapp.MainActivity"
  android:orientation="horizontal"
  android:weightSum="1"
  android:gravity="center_horizontal"&gt;
  
  &lt;ImageButton
      android:layout_width="wrap_content"
      android:layout_height="100dp"
      android:id="@+id/imageButton"
      android:src="#00fe0000"
      android:layout_weight="0.25" /&gt;
  
  &lt;ImageView
      android:layout_width="100dp"
      android:layout_height="174dp"
      android:id="@+id/imageView"
      android:layout_gravity="center_vertical"
      android:layout_weight="0.43" /&gt;
  
  &lt;Button
      style="?android:attr/buttonStyleSmall"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Okay Obama"
      android:id="@+id/obamabutton"
      android:layout_weight="0.25"
      android:gravity="right" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Here is MainActivity.java:</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
      setSupportActionBar(toolbar);
  
      FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
      fab.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                  .setAction("Action", null).show();
  
              //Testing out button changing image to obama
              addButtonClickListener();
  
          }
      });
  }
  public void addButtonClickListener()
  {
      Button obamabutton = (Button)findViewById(R.id.obamabutton);
      obamabutton.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              ImageView obama = (ImageView)findViewById(R.id.imageView);
              obama.setImageResource(R.drawable.obama);
          }
      });
  }
  </code></pre>