Jesse Hill
06/14/2021, 6:26 PMActivity androidx.compose.ui.tooling.preview.PreviewActivity is not protected [android:exported=true]
. I was trying to find out why it’s important for the PreviewActivity
to be exported or if I can make it not exported for my project. As far as I can tell setting android:exported=false
for the PreviewActivity
only affects deploying a @Preview
to the device. Will making this change have any negative effects on a release build of the app? If this is a non-issue, is there a link to release notes/documentation as to why it isn’t an issue?Jesse Hill
06/14/2021, 6:28 PMoverride fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE == 0) {
Log.d(TAG, "Application is not debuggable. Compose Preview not allowed.")
finish()
return
}
intent?.getStringExtra("composable")?.let { setComposableContent(it) }
}
Adam Powell
06/14/2021, 6:57 PMnosuid
06/16/2021, 10:31 AMPreviewActivity
can not be started if the app is not debuggable and there is no impact on release.