title: Image Isn't upating when going back to main activity
body: <p>Ok, I've got two activities, in the main activity there is an image button that takes you to a profile page activity where you can click on another image button and access your photo gallery to set a profile picture which is saved into Firebase storage and as a url in the database. This all works, the problem is that after you do all this and go back to the main activity (I'm overriding the back button and starting a new main activity) the image button shows the previous profile image despite Log.d checks reporting that I am accessing the updated url. Even stranger, if I go into the profile activity again it will display the update profile pic and when I go back to the main activity again the new image will now be displayed correctly. </p>
  
  <p>MainActivity</p>
  
  <pre><code>class MainActivity : AppCompatActivity() {
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          val binding = DataBindingUtil.setContentView&lt;ActivityMainBinding&gt;(this, R.layout.activity_main)
          binding.activity = this
          setSupportActionBar(toolbar)
          val emailer=intent.getStringExtra("passemail")
  
          val toggle = ActionBarDrawerToggle(
                  this, drawer_layout, toolbar, R.string.main_drawer_open, R.string.main_drawer_close)
          drawer_layout.addDrawerListener(toggle)
          toggle.syncState()
  
          val profile = findViewById&lt;de.hdodenhof.circleimageview.CircleImageView&gt;(R.id.profilebutton)
  
          val ref = FirebaseDatabase.getInstance().getReference("/users/$emailer")
  
          val valueEventListener = object : ValueEventListener {
              override fun onDataChange(dataSnapshot: DataSnapshot) {
                  val user = dataSnapshot.getValue(User::class.java)
                  Log.d("msg0 main", "image url: " + user!!.profile_pic);
  
                  if(user!!.profile_pic.length &gt; 0){
  
                          Picasso.get().load(user!!.profile_pic).into(profile)
                  }
              }
              override fun onCancelled(databaseError: DatabaseError) {
                  Log.d("msg0", databaseError.message) //Don't ignore errors!
              }
          }
          ref.addListenerForSingleValueEvent(valueEventListener)
  
          profile.setOnClickListener {
              val intent = Intent(this, ProfilePage::class.java)
              intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK.or(Intent.FLAG_ACTIVITY_NEW_TASK)
              intent.putExtra("passemail",emailer)
              startActivity(intent)
          }
      }
  }
  
  </code></pre>
  
  <p>ProfileActivity</p>
  
  <pre><code>class ProfilePage : AppCompatActivity() {
  
      private lateinit var auth: FirebaseAuth
      private lateinit var profilepic: de.hdodenhof.circleimageview.CircleImageView
      private lateinit var profileURi: Uri
      private lateinit var emailz: String
  
      private fun saveUserToDatabase(profilepicURL: String, emailer:String){
  
          val uid = FirebaseAuth.getInstance().uid ?: ""
          val ref = FirebaseDatabase.getInstance().getReference("/users/$emailer/profile_pic")
          ref.setValue(profilepicURL)
                  .addOnSuccessListener {
                      Log.d("msg0", "saved pic to firebase database, $ref")
  
                  }
                  .addOnFailureListener{
                      Log.d("msg0", "failed to save pic into database, ${it.message}")
                  }
      }
  
      private fun chooseImage() {
          val intent = Intent(Intent.ACTION_PICK)
          intent.type = MediaStore.Images.Media.CONTENT_TYPE
          startActivityForResult(intent, 10)
      }
      override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
          super.onActivityResult(requestCode, resultCode, data)
  
          val emailer=intent.getStringExtra("passemail")
  
          if (requestCode == 10 &amp;&amp; resultCode == Activity.RESULT_OK &amp;&amp; data != null) {
  
              profileURi = data.data
              val bitmap = MediaStore.Images.Media.getBitmap(contentResolver, profileURi)
  
              Log.d("msg0 profileuri", profileURi.toString());
  
              profilepic.setImageBitmap(bitmap)
  
              uploadImagetoFirebase(emailer);
  
          }
      }
  
      private fun uploadImagetoFirebase(emailer:String){
  
          if(profileURi == null) return
          val filename = UUID.randomUUID().toString()
          val ref = FirebaseStorage.getInstance().getReference("/images/$filename")
          ref.putFile(profileURi!!)
                  .addOnSuccessListener {
                      Toast.makeText(this, "Successfully uploaded image ${it.metadata?.path}", Toast.LENGTH_SHORT).show()
                      Log.d("msg0 upload", "image url: " + it.metadata?.path);
  
  
                      ref.downloadUrl.addOnSuccessListener {
                          Log.d("msg1 upload", "image url: " + it);
  
                          Toast.makeText(this, "File Location $it", Toast.LENGTH_SHORT).show()
                          saveUserToDatabase(it.toString(),emailer)
                      }
                  }
      }
  
      override fun onBackPressed() {
  
          val intent = Intent(this, MainActivity :: class.java)
          Log.d("checker2", emailz)
          intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK.or(Intent.FLAG_ACTIVITY_NEW_TASK)
          intent.putExtra("passemail",emailz)
          startActivity(intent)
      }
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.profile_page)
  
          val emailer=intent.getStringExtra("passemail")
          // Initialize Firebase Auth
          auth = FirebaseAuth.getInstance()
  
          emailz = emailer
  
          //Create Image View and set it to call upload when clicked
          profilepic = findViewById&lt;de.hdodenhof.circleimageview.CircleImageView&gt;(R.id.img_profile)
  
          val uid = FirebaseAuth.getInstance().uid ?: ""
          val ref = FirebaseDatabase.getInstance().getReference("/users/$emailer")
  
          val valueEventListener = object : ValueEventListener {
              override fun onDataChange(dataSnapshot: DataSnapshot) {
                  val user = dataSnapshot.getValue(User::class.java)
                  Log.d("msg0 profile", "image url: " + user!!.profile_pic);
  
                  if(user!!.profile_pic.length &gt; 0){
                      Picasso.get().load(user!!.profile_pic).into(profilepic)
                  }
              }
              override fun onCancelled(databaseError: DatabaseError) {
                  Log.d("msg0", databaseError.message) //Don't ignore errors!
              }
          }
          ref.addListenerForSingleValueEvent(valueEventListener)
  
          profilepic.setOnClickListener(View.OnClickListener { chooseImage() })
  
      }
  }
  </code></pre>
  
  <p>I'm using a library for the image buttons, but this problem existed before I added it.  </p>