Is that the walkie-Talkie has a button basically the first time, click on the Flash back, the second time will be much better (if not the case, the continuous use of the basic will not flash back), but occasionally also flash back, quit the software for a while, and then when the landing is still flash back, I really do not understand, paste part of the code, ask the Great God enlighten!
Background processing: Chatbutton is the button that clicked
public void OnCreate (Bundle savedinstancestate)
{
Super.oncreate (savedinstancestate);
Setcontentview (R.layout.chat);
Recorder = new Audiorecorder ();
int groupId = 0;
Audiomanager = (Audiomanager) this.getsystemservice (Context.audio_service);
Onlinenum = (TextView) Findviewbyid (r.id.online_num);
GroupName = (TextView) Findviewbyid (r.id.group_name);
Name= (TextView) Findviewbyid (r.id.name);
Groupphone= (TextView) Findviewbyid (R.id.leader_phone);
Phone = (TextView) Findviewbyid (R.id.phone);
Groupownername = (TextView) Findviewbyid (r.id.leader_name);
Chatbutton = (ImageView) Findviewbyid (R.id.chat_button);
Loudspeaker = (ToggleButton) Findviewbyid (R.id.loudspeaker);
Managebutton = (ImageView) Findviewbyid (R.id.manage_button);
Micoinfo = (TextView) Findviewbyid (r.id.mico_info);
Name.settext (Constant.getcurrentuser (). name);
Phone.settext (Constant.getcurrentuser (). Phone);
Chatbutton.setonclicklistener (this);
Chatbutton.setontouchlistener (New Ontouchlistener ()
{
@Override
public boolean OnTouch (View V, motionevent event)
{
Switch (event.getaction ())
{
Case MOTIONEVENT.ACTION_UP:
Stopspeaking ();
Break
Case Motionevent.action_down:
Tcpwrapper.sendcommand (constant.type_rob_mic);
Micoinfo.settext ("Rob the Wheat ...");
Break
}
return false;
}
});
SendCommand Method:
public static void SendCommand (short messageId)
{
Try
{
if (out = = null)
{
Reconnectsocket ();
}
LOG.D (TAG, "SendCommand (): messageid=" + messageId);
byte[] packet = new BYTE[3];
System.arraycopy (Utils.getbytes (MessageId), 0, packet, 0, 2);
PACKET[2] = (byte) 0;
Out.write (packet);
Out.flush ();
}
catch (IOException E)
{
LOG.E (TAG, "Write Server Data exception:" + E.getmessage ());
Turn off write stream
Try
{
if (out! = null)
{
Out.close ();
out = null;
}
}
catch (IOException IE)
{
LOG.E (TAG, "Turn off write Stream exception:" + Ie.getmessage ());
}
}
catch (NullPointerException e)
{
LOG.E (TAG, "Write Server Data exception:" + E.getmessage ());
}
}
Logcat in the wrong to quote a sentence:
07-24 14:12:40.938:A/LIBC (1661): Fatal signal 8 (SIGFPE) at 0x0000067d (code=-6), thread 1934 (Thread-9866)
The God of Understanding please help, greatly appreciated!
What else do you need to file code please leave a message!