0

How do you integrate adverts with a Canvas view, I am using mobclix, I want the mobclix layout so it appears above the Canvas view. I use the canvas for a game. Can you give code example please.

Simon Sarris
  • 62,212
  • 13
  • 141
  • 171
user997101
  • 77
  • 1
  • 3
  • 11
  • Have you tried using RelativeLayout which uses zIndex according to the appearance in the code? – androidavid Mar 25 '12 at 19:16
  • Hi, yes im using the RelativeLayout I am using setContentView() in the Activity to display the layout. setContentView(R.layout.main) for the main android xml layout and setContentView(_panelView) for the canvas view. I can get it so that either the mobclix advertisement appears or the canvas layout but not both together, any thoughts? Thanks – user997101 Mar 26 '12 at 18:19

1 Answers1

0

Yes! setContentView in the same activity will SET the content, not ADD.

What you have to do is (in your Activity!):

setContentView(R.layout.main);
RelativeLayout r = (RelativeLayout)findViewById(R.id.ID_TO_YOUR_RELATIVE_LAYOUT_ELEMENT);
r.addView(_panelView);
androidavid
  • 1,258
  • 1
  • 11
  • 20