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

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -