make Bluetooth Visible - Android android.bluetooth

Android examples for android.bluetooth:Bluetooth On Off

Description

make Bluetooth Visible

Demo Code

import android.bluetooth.BluetoothAdapter;
import android.content.Context;
import android.content.Intent;

public class Main {

  public static void makeVisible(Context context, int durationSeconds) {
    Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
    discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, durationSeconds);
    context.startActivity(discoverableIntent);
  }//from  w w  w .  ja  v a  2s .  c om

}

Related Tutorials