I know the LayoutInflater
can load View dynamically.Can I jump to other View with LayoutInflater
?
I have write some code,but it doesn't work.
setContentView(R.layout.activity_viewpager);
button = (Button) findViewById(R.id.button);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
LayoutInflater lf = (LayoutInflater) VierPagerTestActivity.this
.getSystemService(LAYOUT_INFLATER_SERVICE);
LinearLayout linear = (LinearLayout)lf.inflate(R.layout.view_item, null);
}
});