I have the following code:
@Override
protected void onPostExecute(Void arg0) {
...
Toast.makeText(getBaseContext(), getBaseContext().getResources().getString(R.string.toast_sync_completed), Toast.LENGTH_SHORT).show();
}
It fails (FC). If pass "Test string"
instead of getResources().getString(R.string.toast_sync_completed)
, then it works correctly. What am I doing wrong?
Change getBaseContext()... to getApplicationContext().....
Toast.makeText(getApplicationContext(), getApplicationContext().getResources().getString(R.string.toast_sync_completed), Toast.LENGTH_SHORT).show();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With