If layout flie(e.g. layout.xml) need to add to acticity using hardcard,below code is ths example
1: controlInflater = LayoutInflater.from(getBaseContext());2: View viewControl = controlInflater.inflate(R.layout.control, null);
3: LayoutParams layoutParamsControl4: = new LayoutParams(LayoutParams.FILL_PARENT,
5: LayoutParams.FILL_PARENT);6: this.addContentView(viewControl, layoutParamsControl);
沒有留言:
張貼留言