Sadeep Weerasinghe
Sadeep Weerasinghe

Reputation: 1087

Is there a space(variable) in android View to store a custom data?

Is there an unused variable in a View object where I can store a string of my own?

Upvotes: 1

Views: 113

Answers (2)

Ashkan Sarlak
Ashkan Sarlak

Reputation: 7344

You can also use setTag(int key, Object tag) and the corresponding getTag(int key) methods to store multiple objects in a view.

Upvotes: 1

Neeraj Kumar
Neeraj Kumar

Reputation: 943

You can use View's setTag(Object obj) method to set tag and getTag() method to retrieve that

Upvotes: 3

Related Questions