这是我的代码:
MyNM = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
int icon = R.drawable.ic_launcher;
String tickerText = "Hello";
Notification notification = new Notification(icon, tickerText, System.currentTimeMillis());
String contentTitle = GetString(R.id.title);
MyI = new Intent(getApplicationContext(), LyceumWebNotification.class);
MyPI = PendingIntent.getActivity(getApplicationContext(), 0, MyI, 0);
notification.setLatestEventInfo(getApplicationContext(), "Hello" , "Title: " + contentTitle, MyPI);
MyNM.notify(NOTIFICATION_ID, notification);
public String GetString(int id){
return ((TextView)this.findViewById(id)).getText().toString();
}
是否可以获取 TextView 的数据并显示为通知的字符序列?