How do I put an admob adview in the settings screen for a live wallpaper?

后端 未结 6 1824
孤街浪徒
孤街浪徒 2020-12-12 23:21

I\'ve seen the Mario live wallpaper uses admob ads in the settings screen, but I haven\'t been able to do it myself. If I put the adview into the settings.xml like you would

6条回答
  •  遥遥无期
    2020-12-12 23:55

    You can implement a settings screen in two ways:

    1. Use the preferences framework so that the XML preferences file auto-creates the preferences layout and all its functionality
    2. Write the activity yourself, i.e. on loading show the current preferences, as they are shown, save them, using a normal layout XML file that you create

    I suspect you are adding the AdMob object to an XML file that cannot handle it, and can onlky handle preference items. Please post your XML file, and specify what casting error you are seeing.

    If you want ultimate control over the contents of the preferences screen, then implement it yourself as a normal activity, and then you can do anything you want.

提交回复
热议问题