i using following lines of code androiddevelopers website (http://developer.android.com/guide/topics/ui/layout/listview.html):
progressbar progressbar = new progressbar(this); progressbar.setlayoutparams(new layoutparams(layoutparams.wrap_content, layoutparams.wrap_content, gravity.center)); progressbar.setindeterminate(true); getlistview().setemptyview(progressbar); // must add progress bar root of layout viewgroup root = (viewgroup) findviewbyid(android.r.id.content); root.addview(progressbar);
the line of code,
progressbar.setlayoutparams(new layoutparams(layoutparams.wrap_content, layoutparams.wrap_content, gravity.center));
seems have error, no layoutparams constructor takes 3 arguments. have progressbar @ center of screen. there fixes above code?
it's import namespace problem. use import line below.
import android.widget.framelayout.layoutparams;
Comments
Post a Comment