Refresh all view in android? -
i working on messaging platform whatsup.when ı send message ı must update screen because ı getting info in db.when press send button ı must update view. googled ı can not exact solution.can help me?
edit:
my code:
relativelayout layout=new relativelayout(this); layoutparams lparams = new layoutparams( 1200,layoutparams.wrap_content); layout.setlayoutparams(lparams); //layout.setbackgroundresource(r.drawable.bubble); // creating new textview textview tv = new textview(this); tv.settext(msgdesc[i]); layout.setgravity(gravity.right); tv.setpadding(30, 10, 0, 0); layout.addview(tv); bubblelayout.addview(layout);
you need phone call either requestlayout()
or invalidate()
depend on update in view
if need view
redraw phone call invalidate()
if alter view
bounds (e.g. size) phone call requestlayout()
android android-layout
No comments:
Post a Comment