I have a preference android:layout gft. I\'ve set the layout in the android:layout property of the preference in the xml file.
Now I need to do an initialization of a bu
You need to create a class that extends Preference
, then override onBindView
and you'll have access to the view.
public class MyPreference extends Preference {
...
@Override
protected void onBindView(View view) {
super.onBindView(view);
View myView = (View) view.findViewById(R.id.my_id);
// ... do stuff
}
}
You'll probably have to override some more methods, read about custom preference in PreferenceActivity - http://developer.android.com/guide/topics/ui/settings.html