Sunday, March 2, 2014

android problem does not know where the problem


Key code:
 
private void Notific (ChatMsg msg) {
NotificationManager nm = (NotificationManager) context
. GetSystemService (Context.NOTIFICATION_SERVICE);
Notification n = new Notification (android.R.drawable.stat_notify_chat,
msg.getText (), System.currentTimeMillis ());
n.flags = Notification.FLAG_AUTO_CANCEL;
Intent i = new Intent (context, ChatActivity.class);
Bundle notiextras = new Bundle ();
notiextras.putString ("state", "initnoti");
notiextras.putString ("myname", myname);
notiextras.putString ("myid", myid);
notiextras.putString ("otherid", msg.getOtherid ());
notiextras.putString ("myip", msg.getMyip ());
notiextras.putString ("otherip", msg.getOtherip ());
notiextras.putString ("date", msg.getDate ());
notiextras.putString ("name", msg.getName ());
notiextras.putString ("text", msg.getText ());
i.putExtras (notiextras);
i.setFlags (Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent contentIntent = PendingIntent.getActivity (context, 10, i, 0);
n.setLatestEventInfo (context, "you come to the news!", msg.getText (), contentIntent);
n.defaults = Notification.DEFAULT_VIBRATE | Notification.DEFAULT_ALL;
nm.notify (100, n);
Log.v ("TextID", msg.getText ());
}




if (intent! = null) {
Log.v ("extrasID", extras.toString () + "" + myid);
Log.v ("extrasID", extras.getString ("state") + extras.getString ("name"));
if (extras.getString ("state"). equals ("initnoti")) {
ChatMsg msg = new ChatMsg (myip,
otherip,
extras.getString ("name"),
extras.getString ("date"),
extras.getString ("text"),
R.layout.example_list_say_he_item);
list.add (msg);
talkView.setAdapter (new ChatMsgViewAdapter (ChatActivity.this, list));
Log.v ("ID", extras.getString ("otherip") + "" + msg.getOtherip () + "" + msg.getMyip ());
myip = msg.getMyip ();
otherip = msg.getOtherip ();
Log.v ("ID", "initnoti" + "" + msg.getText () + "" + extras.getString ("text"));
}


The first jump when notiextras.putString ("text", msg.getText ()); Let's just much, Log.v ("ID", "initnoti" + "" + msg.getText () + "" + extras.getString ("text")); print is how many, but the second time, Log.v ("ID", "initnoti" + "" + msg.getText () + "" + extras.getString (" text ")); first value is printed as Well ah<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
some things, you know, the problem is that every minute things you do not know, it could be a good thing a few days, the problem has been resolved.
Reply:
Top of you, and no one answered my question, help us to see it, thank you
http://bbs.csdn.net/topics/390625246
Reply:
By convention, the need to solve the published solutions

No comments:

Post a Comment