Reputation: 558
I am finalizing my chess project and I have done all the things dynamically in the code, like this:
two_player = new ImageView(ctx);
two_player.setImageResource(R.drawable.twoplayers);
I know I can also do it in the xml file and just find it like this:
ImageView twoplayer = (ImageView) findViewById(R.id.twoplayer);
I am confused which one is faster: dynamically defining or the xml file calling?
Upvotes: 1
Views: 288
Reputation: 24720
of course inflating from xml is slower in run-time but much faster in code-writing-time ;)
Upvotes: 1