1) Add new type AdmobPreference:
public class AdmobPreference extends Preference { public AdmobPreference(Context context) { super(context, null); } public AdmobPreference(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected View onCreateView(ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); return inflater.inflate(R.layout.admob_preference, null); } }2) Add admob_preference.xml to res/layout:
3) Now you can use your type within PreferenceScreen.
...
Комментариев нет:
Отправить комментарий