2

Can i call setcontentview multiple times if my layout is same but the resource changes.for instance if images get exchanged in 2 imageview widgets??(this is infact all that is happening in my app)

SB13
  • 21
  • 1
  • 2

3 Answers3

2

You can switch the setContentView several times. However, I have learned in practice, that UI elements don't cross over. In other words each time you set the view, you have to re-findViewById for your UI elements.

Ashterothi
  • 3,282
  • 1
  • 21
  • 35
0

You should go for ViewFlipper. Follow this link,it may help you.

Calling setContentView() multiple times

Community
  • 1
  • 1
Android Killer
  • 18,174
  • 13
  • 67
  • 90
0

You can "refresh" the ImageViews by calling

myImageView.invalidate();

This will make the view be redrawn. If you're using an AdapterView (such as a ListView) call

myListView.notifyDataSetChanged();

b_yng
  • 14,136
  • 6
  • 32
  • 35