Code example for Message

Methods: getData

0
        mStatusView = (TextView) findViewById(R.id.status);
 
        mUpdateHandler = new Handler() {
                @Override 
            public void handleMessage(Message msg) {
                String chatLine = msg.getData().getString("msg");
                addChatLine(chatLine);
            } 
        }; 
 
        mConnection = new ChatConnection(mUpdateHandler);
 
        mNsdHelper = new NsdHelper(this);
        mNsdHelper.initializeNsd();
 
    } 
 
    public void clickAdvertise(View v) {
        // Register service 
        if(mConnection.getLocalPort() > -1) {
            mNsdHelper.registerService(mConnection.getLocalPort());