title: How to change an image from ImageView when I'm in the different activity
body: <p>I'm working with my diploma thesis, but i can't do this one thing. </p>
  
  <p>This is my MainActivity and in there you have a picture of cars.
  <a href="https://imgur.com/WNFG48q" rel="nofollow noreferrer">https://imgur.com/WNFG48q</a>
  The User can change the car which he is using or he wants to use.
  There you have another activities when he changes a car.
  <a href="https://imgur.com/56aok4B" rel="nofollow noreferrer">https://imgur.com/56aok4B</a>
  <a href="https://imgur.com/hwITcG4" rel="nofollow noreferrer">https://imgur.com/hwITcG4</a>
  When I click "80" (Audi 80) , This site move me to the Main Activity but does not change the picture. (But I Probably know what's happen) </p>
  
  <p>I searched a lot posts on stackoverflow. I found one problem. 
  When I have only:</p>
  
  <p>setContentView(R.layout.activity_home);
  ImageView imageView = (ImageView) findViewById(R.id.carView);                   imageView.setBackground(getResources().getDrawable(R.drawable.ic_audi_80));</p>
  
  <p>This code moves me to the picture R.drawable.ic_audi_80, but when I have intent move me to MainActivity and load default image from android:background(...) (I tried with app:src and it's the same) .</p>
  
  <p>When I haven't "setContentView(R.layout.activity_home);", Android Studio drops me the error Null object exception and marks line "imageView.setBackground....".</p>
  
  <p>AudiActivity where I can choose a car of Audi's cars. </p>
  
  <pre><code>package com.example.bsk69.parkingsystem;
  public class AudiActivity extends AppCompatActivity {
      ArrayAdapter&lt;String&gt; audiAdapter;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_audi);
  
          String[] audiList = {"80"};
          audiAdapter = new ArrayAdapter&lt;&gt;(getApplicationContext(), R.layout.simple_list_item_3,audiList);
          ListView listView = (ListView) findViewById(R.id.audi_list);
          listView.setAdapter(audiAdapter);
          listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
                  if(audiAdapter.getItem(position)=="80"){
                      setContentView(R.layout.activity_home);
                      ImageView imageView = (ImageView) findViewById(R.id.carView);
                      imageView.setBackground(getResources().getDrawable(R.drawable.ic_audi_80));
                      Intent intent = new Intent(AudiActivity.this,HomeActivity.class);
                      startActivity(intent);
                  }
              }
          });
      }
  }
  </code></pre>
  
  <p>MainActivity.xml code where I included ImageView:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@color/colorDarkPurple"
      tools:context=".HomeActivity"&gt;
  
      &lt;ImageView
          android:id="@+id/carView"
          android:layout_width="202dp"
          android:layout_height="325dp"
          android:layout_marginStart="8dp"
          android:layout_marginTop="32dp"
          android:layout_marginEnd="8dp"
          android:background="@drawable/ic_focus"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"
      /&gt;
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p>I need to help from you, how do I change the image in another activity using intent. I believe I have to first move to the MainActivity and then change the image in ImageView.</p>
  
  <p>Thanks for help !
  Regards</p>