salve ragazzi ho bisogno di un aiutino dato che ho ripreso da poco a programamre in java allora io ho questo metodoper richiamare la varibile message con il suo valore settato durante il setupchatcodice:public static String message; private void setupChat() { Log.d(TAG, "setupChat()"); // Initialize the array adapter for the conversation thread mConversationArrayAdapter = new ArrayAdapter<String>(this, R.layout.message); mConversationView = (ListView) findViewById(R.id.in); mConversationView.setAdapter(mConversationArrayAdapter); // Initialize the compose field with a listener for the return key mOutEditText = (EditText) findViewById(R.id.edit_text_out); mOutEditText.setOnEditorActionListener(mWriteListener); // Initialize the send button with a listener that for click events mSendButton = (Button) findViewById(R.id.button_send); mSendButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { //BenvenutoChat.showDialog(10); // Send a message using content of the edit text widget TextView view = (TextView) findViewById(R.id.edit_text_out); message = view.getText().toString(); sendMessage(message); getmessage(); // int number=Integer.parseInt(message);//intero del testo immesso // startActivity(new Intent( BluetoothChat.this, AliceActivity.class)); } });
(il nome della classe è bluetoothchat)
devo scrivere cosi?
BluetoothChat input = new BluetoothChat();
inpline = BluetoothChat.getmessage(); o BluetoothChat.message;
la mia paura è che mi prenda la variabile vuota e quindi non inizializzata con il valore che mi interessa
grazie a tutti

Rispondi quotando