diff --git a/app/src/main/java/org/pixeldroid/app/posts/AlbumActivity.kt b/app/src/main/java/org/pixeldroid/app/posts/AlbumActivity.kt index 2f241f37..eb5982a2 100644 --- a/app/src/main/java/org/pixeldroid/app/posts/AlbumActivity.kt +++ b/app/src/main/java/org/pixeldroid/app/posts/AlbumActivity.kt @@ -1,11 +1,13 @@ package org.pixeldroid.app.posts import android.os.Bundle +import android.view.MenuItem import android.view.View import androidx.appcompat.app.AppCompatActivity import org.pixeldroid.app.databinding.ActivityAlbumBinding import org.pixeldroid.app.utils.api.objects.Attachment + class AlbumActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -36,4 +38,17 @@ class AlbumActivity : AppCompatActivity() { supportActionBar?.setDisplayShowTitleEnabled(false) supportActionBar?.setBackgroundDrawable(null) } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + return when (item.itemId) { + android.R.id.home -> { + // Handle up arrow manually, + // since "up" isn't defined for this activity + onBackPressedDispatcher.onBackPressed() + true + } + + else -> super.onOptionsItemSelected(item) + } + } } \ No newline at end of file