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

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -