Skip to content

Most visited

Recently visited

navigation
AppRestrictionSchema / res / xml /

app_restrictions.xml

1
<?xml version="1.0" encoding="utf-8"?><!--
2
Copyright 2014 The Android Open Source Project
3
 
4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7
 
8
 http://www.apache.org/licenses/LICENSE-2.0
9
 
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
-->
16
<restrictions xmlns:android="http://schemas.android.com/apk/res/android">
17
 
18
    <!--
19
    Refer to the javadoc of RestrictionsManager for detail of this file.
20
    https://developer.android.com/reference/android/content/RestrictionsManager.html
21
    -->
22
 
23
    <!-- Boolean restriction -->
24
    <restriction
25
        android:defaultValue="@bool/default_can_say_hello"
26
        android:description="@string/description_can_say_hello"
27
        android:key="can_say_hello"
28
        android:restrictionType="bool"
29
        android:title="@string/title_can_say_hello"/>
30
 
31
    <!-- String restriction -->
32
    <restriction
33
        android:defaultValue="@string/default_message"
34
        android:description="@string/description_message"
35
        android:key="message"
36
        android:restrictionType="string"
37
        android:title="@string/title_message"/>
38
 
39
    <!-- Integer restriction -->
40
    <restriction
41
        android:defaultValue="@integer/default_number"
42
        android:description="@string/description_number"
43
        android:key="number"
44
        android:restrictionType="integer"
45
        android:title="@string/title_number"/>
46
 
47
    <!-- Choice restriction -->
48
    <restriction
49
        android:defaultValue="@string/default_rank"
50
        android:description="@string/description_rank"
51
        android:entries="@array/entries_rank"
52
        android:entryValues="@array/entry_values_rank"
53
        android:key="rank"
54
        android:restrictionType="choice"
55
        android:title="@string/title_rank"/>
56
 
57
    <!-- Multi-select restriction -->
58
    <restriction
59
        android:defaultValue="@array/default_approvals"
60
        android:description="@string/description_approvals"
61
        android:entries="@array/entries_approvals"
62
        android:entryValues="@array/entry_values_approvals"
63
        android:key="approvals"
64
        android:restrictionType="multi-select"
65
        android:title="@string/title_approvals"/>
66
 
67
    <!-- Hidden restriction -->
68
    <restriction
69
        android:defaultValue="@string/default_secret_code"
70
        android:description="@string/description_secret_code"
71
        android:key="secret_code"
72
        android:restrictionType="hidden"
73
        android:title="@string/title_secret_code"/>
74
 
75
    <!-- Bundle array restriction -->
76
    <restriction
77
        android:description="@string/description_items"
78
        android:key="items"
79
        android:restrictionType="bundle_array"
80
        android:title="@string/title_items">
81
        <!-- Bundle array must have one bundle restriction -->
82
        <restriction
83
            android:key="item"
84
            android:restrictionType="bundle"
85
            android:title="@string/title_item">
86
            <restriction
87
                android:key="key"
88
                android:restrictionType="string"
89
                android:title="@string/title_key"/>
90
            <restriction
91
                android:key="value"
92
                android:restrictionType="string"
93
                android:title="@string/title_value"/>
94
        </restriction>
95
    </restriction>
96
 
97
</restrictions>
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.