Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android XML. What is the purpose of the star in the ID string?

Tags:

android

In some sources I see such declarations

<item
    android:id="@+id/menu_display_groups"
    android:icon="@*android:drawable/ic_menu_allfriends"
    android:title="@string/menu_displayGroup" />

Notice the *

@*android:

It seems to give access to internal resources. But would like to know for sure.

Also curious, if it is safe to build application with such declarations using Android 2.2 SDK, and run it on 1.5.

like image 294
alex2k8 Avatar asked Jan 16 '11 03:01

alex2k8


People also ask

How to write special characters in string XML in Android?

How can I write character & in the strings. xml? In android studio, you can simply press Alt+Enter and it will convert for you.

What is the use of strings XML file in Android?

A string resource provides text strings for your application with optional text styling and formatting. There are three types of resources that can provide your application with strings: String. XML resource that provides a single string.


1 Answers

You are correct, it gives access to internal resources for platform apps. It is NOT safe to build apps with such declarations unless you are building a bundled app within a full system image.

Internal resources can (and do) change/get removed not only from platform version to platform version, but also from device to device or device version to device version.

like image 199
adamp Avatar answered Oct 20 '22 22:10

adamp