0
我想刪除Android Studio中相對佈局的所有圖像,保存並稍後替換它們。如何證明一個對象是否是一個imageview?
RelativeLayout rl = (RelativeLayout) findViewById(R.id.relativeLayout);
ArrayList al = rl.getTouchables();
rl.removeAllViews();
//do something
for(int i=0; i<al.size(); i++)
{
if(al.get(i).equals(new ImageView(this)))
rl.addView((ImageView) al.get(i));
}
的PROGRAMM不工作:(
instanceof? ref:http://stackoverflow.com/questions/7313559/what-is-the-instanceof-operator-used-for –