Enable/disable an activity programmatically

前端 未结 4 1553
被撕碎了的回忆
被撕碎了的回忆 2020-12-06 01:30

I have an activity in in my app which I have kept as

android:enabled=\"false\"

now I want that when a button is clicked it should get chan

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-06 02:08

    In case you're using productFlavors, you can have separate AndroidManifest files for each flavor. In those you can easily override properties from the main Manifest file. When building a particular flavor manifest merger merges the Manifest based on the selected flavor.

    In the flavor's manifest where you want to disable a particular activit you can do it like this

        
        
    

提交回复
热议问题