Having a problem calling setDefaultDisplayHomeAsUp...
# android
b
Having a problem calling setDefaultDisplayHomeAsUpEnabled. The tutorial I am doing actually says I should use
Copy code
supportActionBar?.setDefaultDisplayHomeAsUpEnabled(enableHome)
but this gives more errors, the version I am trying with true gives `ActionBar.setDefaultDisplayHomeAsUpEnabled can only be called from within the same library group prefix (referenced groupId=
androidx.appcompat
with prefix androidx from groupId=
Flicker Browser
)` Any ideas?
Copy code
package com.funkytwig.flickerbrowser

import android.util.Log
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar

private const val TAG = "BaseActivity"

// internal as don't have to be available outside this project ?? check ??
internal const val FLICKER_QUERY = "FLICKER_QUERY"
internal const val PHOTO_TRANSFUR = "PHOTO_TRANSFUR"

open class BaseActivity : AppCompatActivity() {
    internal fun activateToolbar( home:Boolean) {
        Log.d(TAG, "activateToolbar")

        var toolbar = findViewById<View>(R.id.toolbar) as Toolbar
        setSupportActionBar(toolbar)
        supportActionBar?.setDefaultDisplayHomeAsUpEnabled(true) // does not work

    }
}
­čžÁ 1
­čśÂ 1
c
Hey Ben, please have a look at the channel description for places where to ask your general android question. This workspace is meant for kotlin related questions https://kotlinlang.org/community/slackccugl.html#common-channels