Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

2 votes
0 answers
395 views

Unable to bind MediaPlaybackService with intent and unable to detect MediaSessionCompat.Callbacks

I have been trying to detect media key events of a bluetooth headset with the help of a service but the app crashed with the following error: java.lang.RuntimeException: Unable to bind to service pk....
Adnan Arshad's user avatar
1 vote
1 answer
300 views

How do I make my device discover-able to nearby device without confirmation dialog via Bluetooth?

I had make an application related to Bluetooth connection in Android, every time when I enable Bluetooth, it shows a confirmation dialog that make your device discover able no near by device. Is ...
Dhruv's user avatar
  • 121
0 votes
1 answer
1k views

bluetooth enable discoverable intent returns No Activity found to handle Intent

When I start my main activity, it has a function that enables bluetooth discovery after checking if bluetooth is on. I call the intent from the bluetooth adapter based on this android bluetooth ...
user3559233's user avatar
3 votes
3 answers
3k views

Prevent onDestroy when Bluetooth connection state changes

Goal If an already connected bluetooth device disconnects, and an Activity is already running, close the Activity Problem When the bluetooth device connection state changes through ...
shellström's user avatar
  • 1,427
1 vote
2 answers
600 views

Prevent a new Activity from spawning when a Bluetooth device connects

Goals If a bluetooth device connects, and no Activity is running, start Activity If a bluetooth device connects, and an Activity is already running, connect to the already running Activity Problem ...
shellström's user avatar
  • 1,427
0 votes
2 answers
2k views

share file over bluetooth opp in Android N

What i am trying is to share a file over bluetooth. I have tried below two methods to pass the file name to the ACTION_SEND intend. share activity is pop'ing up and when i touch the connected ...
Rilwan's user avatar
  • 2,291
1 vote
1 answer
281 views

Android activity results not being checked

I have an app that goes LoginActivity -> MainActivity. Main activity is started like this as I dont want LoginActivity to be added to the stack: Intent intent = new Intent(LoginActivity.this, ...
Simon's user avatar
  • 10k
5 votes
1 answer
3k views

Take photo with button simulate programmatically like the selfie stick via bluetooth

So i have a bluetooth device, i listen to button press on the device and i try to take a photo when the button is pressed. The issue is i didn't find any solution to do this. } else if (destination....
Tazz's user avatar
  • 801
0 votes
1 answer
383 views

pass data to broadcast receiver that already has intent filter coming from activity

when the phone is connected to the bluetooth in the car. I want my app to switch on automatically. to do this i have to save the paired car bluetooth device name to a string. then when the phones ...
Andrew Irwin's user avatar
4 votes
2 answers
5k views

Android: How to control music service play/pause from bluetooth device?

Developing a music app. In my Music Service, I have written a custom broadcast receiver. It works with Intent.ACTION_HEADSET_PLUG but not with Intent.ACTION_MEDIA_BUTTON. Please guide on how to ...
WideFide's user avatar
  • 335
1 vote
2 answers
3k views

How to pass message to Bluetooth Activity from another activity

I build an Android app that control RC car. This app have two activities, Bluetooth Activity and Direction Activity. In Bluetooth activity I used list view to list all the devices and connect with ...
a.alharazi's user avatar
6 votes
1 answer
426 views

How do you intercept Bluetooth button events from a Parrot B350-XT Bluetooth headset?

My Bluetooth headset (Parrot B350-XT) has 4 buttons: Volume Up Volume Down Power button "Parrot" button I am creating an Android application (OS 4.4.2) running on Samsung's SM-T230NU. I would like ...
user1884325's user avatar
  • 2,550
0 votes
1 answer
105 views

How can i manage my Ble connection?

I have 3 Activitys: Activity A,Activity B,Activity C. B and C is intent from A; I create connnect like: mBluetoothGatt = device.connectGatt(mContext, false, mGattCallback); I know that the number ...
tiny sunlight's user avatar
2 votes
1 answer
755 views

How to know which intent is selected in Intent.ACTION_SEND in android

want to use Android Intent.ACTION_SEND for quickly sharing something. i wrote some code and i can show custom shearing dialog but i want to check intent is selected in Intent.ACTION_SEND,for example ...
donoachua's user avatar
  • 193
0 votes
1 answer
2k views

Sending a contact .vcf file

i want to send a contact vcf file using the bluetooth and email. I have tried but i keep getting errors. Please help. Thanks This is my sendByBluetooth method. public void sendByBluetooth(){ ...
Williams Tobi's user avatar

15 30 50 per page