Adding a Startapp banner programmatically??

Hey guys, i just started using Startapp in some apps but i would like some help. Whenever I try adding the banner programmatically i get this error message saying “mainLayout cannot be resolved or is not a field”.
No matter what I do, I cant seem to solve it. Any help would be appreciated.

https://www.dropbox.com/s/esekdrib2nk8zvu/45.png?dl=0

Thanks in advance

You should add your banner view to the main layout of your activity. It can’t be called ‘mainLayout.xml’ it’s more like ‘main_layout.xml’ (no capital chars allowed).

And it should be visible on ‘R.layout.main_layout’, not ‘R.id.main_layout’.

hey thanks alot for the info, took your advice which caused the error to go away but now the game crashes.:mad:
dont know whats going on

You could try doing it this way https://support.startapp.com/entries/27804376-Adding-a-banner-with-Java-Code-instead-of-XML

Hey, appreciate the input buts that’s actually what I tried that’s giving me the error

Its best to paste crash error log.also pls share ur XML layout code