Generate Runtime Resource Identifier?

I write a user preference using the search bar while it works, except for one problem, the identifier of my search bar is defined in XML, so when I try to use 2 of my user preferences, and then I update the Search Panel I cannot distinguish between the two.

SeekBar bar = (SeekBar)view.findViewById(R.id.PreferenceSeekBar);

Is there a way to generate a custom resource id at runtime? Or maybe another way to solve this problem?

Thanks Jason

0
source share
2 answers

in the onBind ovverriden method of user preference, you are given a view of the view containing all representations of the current preference activity.

Preference onBind(). onBindView(). , View, onBindView(), View, onCreateView(), View, , . .

, findViewById() , Preference, - .

, PreferenceActivity ListActivity. Preference , View Preference .

+1

:

setTag() findViewWithTag();

: TableRow

+1

All Articles