I have an abstract class which contains method for setting header text. It looks like:
TextView header = (TextView) findViewById(R.id.hTitle);
header.setText(getString(this.getHeaderStringID()));
At this moment methods that override the abstract getHeaderStringID() return integers like 0x7f040001.
1 I wonder whether there’s a way to utilize concatenation or somewhat similar to achieve this:
header.setText(getString(R.string.!getHeaderStringID!));
In desired case getHeaderStringID would return string like “sAboutHeader”
2 I’m new to Java – can I get rid of creating header object. If I don’t do like that, eclipse validator says that the appropriate method isn’t found and doesn’t let me launch app.
If I understand you correctly, I think that you should use reflection:
the value variable could be given as an input to the getString() function.