BroadcastReceiver에서 Toast에 getString으로 string에 저장된 문자를 불러올려니까 오류나네요...
원인좀 알려주세요...
@Override
public void onReceive(Context context, Intent intent)
{
Toast.makeText(context, getString(R.string.wake_up), Toast.LENGTH_SHORT).show();
그냥 " " 안에 글쓰면 되는데 저렇게 하니까 안되네요... ㅠㅜ
Typically this file will be called "strings.xml", and must be placed in the
valuesdirectory:The strings can now be retrieved by your application through the symbol specified in the "id" attribute:
Unlike system resources, the resource symbol (the R class) we are using here comes from our own application's package, not android.R.
Note that the "mainLabel" string is complex, including style information. To support this, the
getString()method returns aCharSequenceobject that you can pass to aTextViewto retain those style. This is why code must calltoString()on the returned resource if it wants a raw string.이런 내용이 있던데 맞는지... 미확인...;;