I have a code like this
if(POS>=5){
Toast.makeText(SubActivity.this,R.string.last,Toast.LENGTH_SHORT).show();
}else {
POS += 1;
fillDetails(POS);
}
I want to get this "5" in if(POS>=5)
from strings.xml
In strings.xml
I have
<string name="lastarticle">5</string>
I have tried these
if(POS>=R.string.lastaricle)
if(POS>=getString(R.string.lastaricle))
if(POS>=getResources().getString(R.string.mess_1))
if(POS>=this.getString(R.string.resource_name))
if(POS>=@string/lastarticle)
but none of them worked. I think I miss something but I don't know what it is?