J2ME联网中采用序列化机制[3]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

    private void exitMIDlet()
    {
        try
        {
            destroyApp(false);
            notifyDestroyed();
        } catch (MIDletStateChangeException e)
        {
            e.printStackTrace();
        }
    }

protected void pauseApp()
    {
            }


    protected void destroyApp(boolean arg0) throws MIDletStateChangeException
    {
            }


    public void commandAction(Command arg0, Displayable arg1)
    {
        if(arg0 == connectCommand)
        {
            String name = userName.getString();
            String mail = email.getString();
            int myAge = Integer.parseInt(age.getString());
            int i = gender.getSelectedIndex();
            boolean myGender = i==0?true:false;
            Account account = new Account(name,mail,myAge,myGender);
            nt.setAccount(account);
        //   System.out.println(account.toString());
            synchronized(this)
            {
                notify();
            }             
           
        }
        else if(arg0 == exitCommand)
        {
            exitMIDlet();
        }

    }

    class NetworkThread extends Thread
    {
        private NetworkMIDlet midlet;
        private boolean going = true;
        private Account account = null;

        public NetworkThread(NetworkMIDlet midlet)
        {
            this.midlet = midlet;
        }

        public synchronized void setAccount(Account account)
        {
            this.account = account;
        }

本文关键:J2ME联网中采用序列化机制
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top