@Override
public void onStart(Intent intent, int startId) {
// TODO Auto-generated method stub
super.onStart(intent, startId);
Toast.makeText(this, "Service started", Toast.LENGTH_SHORT).show();
final String str=intent.getStringExtra("str");
Log.v("debugging", str);
NotificationManager nm = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
Intent i = new Intent(Myservice.this, Display.class);
PendingIntent pi = PendingIntent.getActivity(Myservice.this, 0, i, 0);
Notification n = new Notification(R.drawable.ic_launcher,str, System.currentTimeMillis());
n.setLatestEventInfo(Myservice.this,"New message for you: ", str, pi);
nm.notify(1,n);
}
现在我想将“str”即数据显示到另一个 xml 中的 textview 中。我怎样才能做到这一点?