Because part of the interface, such as a fragment, his layout file is almost a few lines of code and the fragmentxml of several list lists are almost identical.
The number of XML spikes this time some small layout in the code I feel better.
Also helps prevent anti-compilation
PackageYangdc.common.fragment.base;ImportCom.handmark.pulltorefresh.library.PullToRefreshBase.Mode;ImportCom.handmark.pulltorefresh.library.PullToRefreshListView;ImportAndroid.os.Bundle;ImportAndroid.view.LayoutInflater;ImportAndroid.view.View;ImportAndroid.view.ViewGroup;ImportAndroid.widget.FrameLayout;ImportAndroid.widget.LinearLayout; Public class baselistfragment extends basefragment{ PublicPulltorefreshlistview Pulltorefreshlistview; PublicViewOncreateview(Layoutinflater inflater, ViewGroup container, Bundle savedinstancestate) {Framelayout Framelayout =NewFramelayout (Getactivity ()); Pulltorefreshlistview =NewPulltorefreshlistview (Getactivity (), Mode.both); Pulltorefreshlistview.setlayoutparams (NewLinearlayout.layoutparams (LinearLayout.LayoutParams.MATCH_PARENT, L InearLayout.LayoutParams.MATCH_PARENT)); Framelayout.addview (Pulltorefreshlistview);returnFramelayout; }@Override Public void onCreate(Bundle savedinstancestate) {Super. OnCreate (Savedinstancestate); }}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Java-only way to develop the Android UI interface