I need to associate several tags to a view so I use
view.setTag(id, tag_object)
Unfortunately Android requires to have the id as defined in a resource. However R file is auto generated of resource ids appearing in different resource files, so I do not know how to create an id detached from any resource. As work around I just use id of some resource but it isn't robust, because if I decide to remove the resource, the id can disappear. It is also reduces readability of the code having some weird id for addressing a tag. Perhaps I missed very simple trick as ids resource file.
Navigate to your storage account in the Azure portal. On the Overview page, in the Essentials section, select the JSON View link. The resource ID for the storage account is displayed at the top of the page.
All resource IDs are defined in your project's R class, which the aapt tool automatically generates. When your application is compiled, aapt generates the R class, which contains resource IDs for all the resources in your res/ directory. For each type of resource, there is an R subclass (for example, R.
The Resource ID indicates the position of the resource in relation to other resources. How Calculated As you add resources, Project automatically assigns the next number in the sequence of resources as listed. This becomes the Resource ID. Best Uses The only view that the Resource ID field appears in is the Task Form.
int resourceId = this. getResources(). getIdentifier("nameOfResource", "id", this.
There is a resource type "id" that lets you define arbitrary resource IDs:
http://developer.android.com/guide/topics/resources/more-resources.html#Id
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item type="id" name="foo"/>
<item type="id" name="bar"/>
</resources>
Will generate R.id.foo
and R.id.bar
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With