/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.uul); initLayout(); // get robotType from intent robotType = (Integer) getIntent().getSerializableExtra("robotType"); // Create objects for communication mNXT = new BTCommunicator(this, null, BluetoothAdapter.getDefaultAdapter(), getResources()); handler = new Handler(); // Create and launch the upload thread uploadThread = new UploadThread(this, getResources()); uploadThread.setBluetoothCommunicator(mNXT); uploadThread.start(); }