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 に答える