示例#1
0
        public override void onListItemClick(ListView l, View v, int position, long id)
        {
            string path = mCurrentPath + mArrayList[position];
            File   file = new File(path);

            if (file.Directory)
            {
                if (path.IndexOf(PARENT_DIRECTORY_PATH, StringComparison.Ordinal) > 0)
                {
                    mCurrentPath = file.ParentFile.Parent + DIRECTORY_DELIMITER;
                }
                else
                {
                    mCurrentPath = path;
                }
                createDirectoryList(new File(mCurrentPath));

                mTextView.Text = mCurrentPath;
                mAdapter.notifyDataSetChanged();
            }
            else
            {
                if (!path.EndsWith(".fls", StringComparison.Ordinal) && !path.EndsWith(".bin", StringComparison.Ordinal))
                {
                    Toast.makeText(this, "Must choose .fls or .bin file", Toast.LENGTH_SHORT).show();
                }
                else
                {
                    Intent data = new Intent();
                    data.putExtra(MainActivity.FIRMWARE_FILE_NAME, path);
                    setResult(MainActivity.RESULT_CODE_SELECT_FIRMWARE, data);
                    finish();
                }
            }
        }
示例#2
0
        private void setBondedDevices()
        {
            logicalName = null;
            bondedDevices.Clear();

            BluetoothAdapter       bluetoothAdapter = BluetoothAdapter.DefaultAdapter;
            ISet <BluetoothDevice> bondedDeviceSet  = bluetoothAdapter.BondedDevices;

            foreach (BluetoothDevice device in bondedDeviceSet)
            {
                bondedDevices.Add(device.Name + DEVICE_ADDRESS_START + device.Address + DEVICE_ADDRESS_END);
            }

            if (arrayAdapter != null)
            {
                arrayAdapter.notifyDataSetChanged();
            }
        }