Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cant get to resources from broadcastreceiver

for some reason i cant get the string that are inside the strings.xml. this is my code:

public class SDK_Referrer extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {  
String srt = context.getResources().getString(R.string.master);

its not recognising the "master" string. when i check for what options i get in R.string... i get things like R.string.copy, or R.string.cancel, or R.string.ok... and not the strings that i have in the xml file. why is that?

like image 890
roiberg Avatar asked Oct 07 '22 20:10

roiberg


1 Answers

You might be importing android.R instead the one from your own app;

like image 51
ᅙᄉᅙ Avatar answered Oct 12 '22 12:10

ᅙᄉᅙ