0

我想通过调用 R.string.app_name 来放置通知的动态标题,但我无法将其转换为 CharSequence。R.string 返回一个与通知不兼容的整数 id。这是尝试

CharSequence tickerText = R.string.app_name; //Error

Notification notification = new Notification(R.drawable.ico, tickerText,System.currentTimeMillis());

我该怎么做?

4

1 回答 1

0
CharSequence tickerText = getApplicationContext().getString(R.string.app_name);
于 2012-12-06T15:02:01.800 回答