Code example for ViewStub

Methods: inflate

0
 
    private View getStubView(int stubId, int viewId) {
        View view = findViewById(viewId);
        if (view == null) {
            ViewStub stub = (ViewStub) findViewById(stubId);
            view = stub.inflate();
        } 
 
        return view;
    } 
 
    private class MessageOnClick implements OnClickListener {
        private int mWhat;
 
        public MessageOnClick(int what) {
            mWhat = what;
        } 
 
        public void onClick(View v) {
            Message msg = Message.obtain(mHandler, mWhat);
Stop searching for code, let great code find you!  Add Codota to your java IDE