if i need to use a resource twice, is it better to store it in a String?
public class Testing extends Activity{
private String c_stringName;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
c_stringName= this.getString(R.string.name);
}
}
If you dig down to the machine. The only difference between them is 1 reference.
it may seem like running multiple
c_stringName= this.getString(R.string.name);
is doing alot of work but its is the same and storing it into a string reference.
Tags: androidandroid