I want to know that I have a file with a string.xml file that contains status messages. Now I want to process them by their identifier. I wrote the following code, but it does not work on Message = res.getString(Msgid);and logs Resource not found Exception.
Can anyone help me?
public void FileStatusMsg(int Msgid)
{
String Message = null;
Resources res = this.getResources();
Message = res.getString(Msgid);
AlertDialog.Builder builder = new AlertDialog.Builder(OfficeLinQ.this);
builder.setMessage(Message).setCancelable(false).setPositiveButton(
"OK", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int id)
{
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
}
source
share