Commit 50fe805e authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Apparently the category sometimes isn't passed in the intent

parent b4433297
......@@ -30,7 +30,10 @@ import com.frostnerd.smokescreen.util.LanguageContextWrapper
class SettingsActivity : BaseActivity() {
companion object {
private var category:Category? = null
fun showCategory(context: Context, category: Category) {
this.category = category
Intent(context, SettingsActivity::class.java).apply {
putExtra("category", category)
}.also {
......@@ -52,7 +55,7 @@ class SettingsActivity : BaseActivity() {
super.onCreate(savedInstanceState)
supportFragmentManager.beginTransaction().replace(android.R.id.content, SettingsFragment().apply {
arguments = Bundle().apply {
putSerializable("category", intent.getSerializableExtra("category")!!)
putSerializable("category", intent.getSerializableExtra("category") ?: category ?: Category.GENERAL)
}
}).commit()
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment