How to display RelativeLayout and ImageView on Android? -


i have added relativelayout , imageview dynamically, it's not displaying in emulator when run application. why?

my code:

relativelayout relativelayout = new relativelayout(this);     relativelayout.layoutparams lp = new relativelayout.layoutparams(                  relativelayout.layoutparams.wrap_content,              relativelayout.layoutparams.wrap_content);     imageview iv = new imageview(this);              iv.setimageresource(r.drawable.freshface_mmm);     relativelayout.addview(iv,lp); 

you need add relative layout activity using:

    setcontentview(view, params); 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -