Is it possible in Android to draw a widget in an Activity
only if a boolean
value equals true? Basically, I'd like to hide a Button
if the currently logged in user isn't an administrator, but display if they are.
Is something like this possible? I haven't noticed a widget property that could provide the functionality I seek, but I'm hoping I'm overseeing something. A less desirable alternative would be to create an Intent to a completely separate administrator focused Activity
, and load an administrator specific layout.xml, but that immediately creates an significant amount of duplicate code.