Android Open Source - BleSensorTag Enable Bluetooth Dialog

From Project

Back to project page BleSensorTag.


The source code is released under:

MIT License

If you think the Android project BleSensorTag listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package sample.ble.sensortag.dialogs;
// www  .j ava2  s . c o m
import android.content.DialogInterface;
import android.os.Bundle;

import sample.ble.sensortag.R;

public class EnableBluetoothDialog extends AppDialog<EnableBluetoothDialog.EnableBluetoothDialogListener> {
    public static final String TAG = EnableBluetoothDialog.class.getSimpleName();

    public interface EnableBluetoothDialogListener {
        public void onEnableBluetooth(EnableBluetoothDialog f);
        public void onCancel(EnableBluetoothDialog f);

    public EnableBluetoothDialog() {

    protected boolean isListenerOptional() {
        return false;

    public Dialog onCreateDialog(Bundle savedInstanceState) {
        final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
        .setPositiveButton(R.string.turn_on, new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int whichButton) {
        .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {

        return builder.create();

Java Source Code List