제가 intent를 이용해서 데이터를 첫번째 액티비티에서 두번째 액티비티로 보내 출력하는거 인데요
어플을 핸드폰에서 실행했을때 알수없음이라고 뜨면서 바로 꺼지네요 ㅜㅜ
어디가 틀린건가요
첫번째 액티비티
public void run() {
Log.i(TAG, "BEGIN mConnectedThread");
byte[] buffer = new byte[1024];
int bytes;
// Keep listening to the InputStream while connected
while (true) {
try {
// Read from the InputStream
String message1="";
while (message1.length()<9) {
bytes = mmInStream.read(buffer);
message1 = message1.concat(new String(buffer,0,bytes));}
Intent intent =new Intent(BlueToothService.this, MainController.class);
intent.putExtra("SendData_Key",message1);
startActivity(intent);
} catch (IOException e) {
Log.e(TAG, "disconnected", e);
connectionLost();
break;
}
}
}
2번째 액티비티
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
setOnClickListener((ViewGroup)findViewById(R.id.tblButtons));
mStatus = (TextView) findViewById(R.id.txtStatus);
// Get local Bluetooth adapter
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
mmessage = (TextView) findViewById(R.id.Tv1);
Intent intent = getIntent();
String receivedData = intent.getStringExtra("SendData_Key");
setResult(RESULT_OK,intent);
mmessage.setText(receivedData);