クラス内でこのメソッドを解決できないのはなぜですか?このクラスは主なアンドロイドクラスから外れています。私は主なクラスのメソッドは、他のクラスではなく、うまく動作します。このコードのメソッドstartActivityforresultsを解決できません
class blu {
public blu(){
}
public boolean comprobarBluetooth(Context context){
CharSequence text = "No tiene Bluetooth";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
//mirem si hi ha bluetooth al aparell
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if(mBluetoothAdapter==null) {
//disparo un toast per informar
return false;
}else{
if (!mBluetoothAdapter.isEnabled()) {
//si està apagat obrim el dialeg per activarlo.
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
}//SI startActivityForResult torna un OK faig return true, i executo el metode de buscar dispositivos
}
return true;
}