Forum Xamarin.Android

how do you set the Activity Attribute android:lockTaskMode="if_whitelisted"

There does not seem to be an Activity Attribute for this when targeting API 23. Is this an oversight? Is there a way to do this in the manifest manually?

Answers

  • BerayBentesenBerayBentesen TRUniversity ✭✭✭✭

    @MichaelHartman

    There does not seem to be an Activity Attribute for this when targeting API 23

    Were you able to use attribute before targeting api level 23 ?

    Check here for Xamarin api documentation.

  • MichaelHartmanMichaelHartman USMember ✭✭

    The attribute is new to API 23 so no. I am trying to set the Activity Attributes when declaring the Activity class like such:

    [Activity(Label = "ActivityName", Icon = "@drawable/icon", Theme = "@style/Theme.Main", LockTaskMode = "if_whitelisted")]
    [IntentFilter(new[] { Intent.ActionMain }, Categories = new[] { Intent.CategoryHome, Intent.CategoryDefault })]
    public class MainActivity : Activity
    { 
        ... 
    }
    

    But I LockTaskMode is not defined as an attribute in Xamarin, although it exists in API 23 for android

Sign In or Register to comment.