控件对象直接赋值给另一个怎么不行··为什么小白求解
public class MainActivity extends Activity {
private ImageView imageView;
private ImageView imageView2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
imageView = new ImageView(this);
imageView.setImageResource(R.drawable.appdrawflat);
imageView2 =(ImageView) findViewById(R.id.image);
imageView2 = imageView;
}
}
显示空白 为什么直接把控件对象赋值给另一个.怎么就不行?谢谢给位解答下