Example usage for android.content Context BIND_AUTO_CREATE

List of usage examples for android.content Context BIND_AUTO_CREATE

Introduction

In this page you can find the example usage for android.content Context BIND_AUTO_CREATE.

Prototype

int BIND_AUTO_CREATE

To view the source code for android.content Context BIND_AUTO_CREATE.

Click Source Link

Document

Flag for #bindService : automatically create the service as long as the binding exists.

Usage

From source file:biz.wiz.android.wallet.service.BlockchainStateLoader.java

@Override
protected void onStartLoading() {
    super.onStartLoading();

    broadcastManager.registerReceiver(broadcastReceiver,
            new IntentFilter(BlockchainService.ACTION_BLOCKCHAIN_STATE));

    final Context context = getContext();
    context.bindService(new Intent(context, BlockchainServiceImpl.class), serviceConnection,
            Context.BIND_AUTO_CREATE);
}

From source file:com.grishu.listviewanimations.MainActivity.java

@SuppressLint("InlinedApi")
@Override/*from   www  .j  av a 2  s  .  co  m*/
protected void onCreate(Bundle savedInstanceState) {
    if (Build.VERSION.SDK_INT >= 19) {
        getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
    }

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    bindService(new Intent("com.android.vending.billing.InAppBillingService.BIND"), mServiceConn,
            Context.BIND_AUTO_CREATE);
}

From source file:eu.esu.mobilecontrol2.sdk.MessageServiceFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReceiver = new Messenger(new IncomingMessageHandler(new WeakReference<>(this)));

    // Ignore input services on 3rd party devices to prevent crashes.
    if (MobileControl2.isMobileControl2() && InputServices.isInstalled(getActivity())) {
        getActivity().bindService(getServiceIntent(), mConnection, Context.BIND_AUTO_CREATE);
    }//from w  w w.  ja v a2  s  .com
}

From source file:net.kourlas.voipms_sms.Billing.java

/**
 * Initializes an instance of the Billing class.
 *
 * @param applicationContext The application context.
 *//* w w  w .j  a  v a2 s. co m*/
public Billing(Context applicationContext) {
    this.applicationContext = applicationContext;

    serviceConnection = new ServiceConnection() {
        @Override
        public void onServiceDisconnected(ComponentName name) {
            billingService = null;
        }

        @Override
        public void onServiceConnected(ComponentName name, IBinder service) {
            billingService = IInAppBillingService.Stub.asInterface(service);
        }
    };

    Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
    serviceIntent.setPackage("com.android.vending");
    applicationContext.bindService(serviceIntent, serviceConnection, Context.BIND_AUTO_CREATE);
}

From source file:com.agrn.senqm.network.Message.java

public void send(Context context) {
    if (!ConnectionManagerService.isRunning())
        return;/*from  w w  w  .j av  a2 s.  co m*/

    LocalServiceConnection serviceConnection = new LocalServiceConnection(context);
    Intent intent = new Intent(context, ConnectionManagerService.class);
    context.bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE);
}

From source file:com.glabs.homegenie.util.UpnpManager.java

public void bind() {
    // TODO test UPnP discovery
    _hgcontext.getApplicationContext().bindService(new Intent(_hgcontext, AndroidUpnpServiceImpl.class),
            serviceConnection, Context.BIND_AUTO_CREATE);
}

From source file:name.vdg.respi55.SettingsActivity.java

@Override
protected void onResume() {
    super.onResume();
    Intent intent = new Intent(this, RespiStateManager.class);
    bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
}

From source file:com.matthewmitchell.peercoin_android_wallet.service.BlockchainStateLoader.java

@Override
protected void onStartLoading() {
    super.onStartLoading();

    broadcastManager.registerReceiver(broadcastReceiver,
            new IntentFilter(BlockchainService.ACTION_BLOCKCHAIN_STATE));
    final Context context = getContext();

    assertTrue(((WalletApplication) context.getApplicationContext()).getConfiguration() != null);

    context.bindService(new Intent(context, BlockchainServiceImpl.class), serviceConnection,
            Context.BIND_AUTO_CREATE);
}

From source file:com.coinblesk.client.wallet.Outputs.java

@Override
public void onCreate(Bundle state) {
    super.onCreate(state);
    Intent walletServiceIntent = new Intent(getActivity(), WalletService.class);
    getActivity().bindService(walletServiceIntent, serviceConnection, Context.BIND_AUTO_CREATE);

    adapter = new OutputsAdapter(null, this);

    LocalBroadcastManager broadcastManager = LocalBroadcastManager.getInstance(getActivity());
    IntentFilter coinsSentOrReceivedFilter = new IntentFilter();
    coinsSentOrReceivedFilter.addAction(Constants.WALLET_COINS_SENT_ACTION);
    coinsSentOrReceivedFilter.addAction(Constants.WALLET_COINS_RECEIVED_ACTION);
    broadcastManager.registerReceiver(onCoinsSentOrReceived, coinsSentOrReceivedFilter);
}

From source file:com.wifi.brainbreaker.mydemo.spydroid.ui.PreviewFragment.java

@Override
public void onResume() {
    super.onResume();
    getActivity().bindService(new Intent(getActivity(), CustomHttpServer.class), mHttpServiceConnection,
            Context.BIND_AUTO_CREATE);
    getActivity().bindService(new Intent(getActivity(), CustomRtspServer.class), mRtspServiceConnection,
            Context.BIND_AUTO_CREATE);
}