Unfortunately, it's quite not possible. Tasker cannot detect an app crash.
However, we can still do something about it.
Let's first make a profile that does the killing job. It will be executed when the bluetooth goes off.
Note: If killing even with root is not working (there could be some problem with your Tasker or root), you can try the following shell command:
am force-stop packagename
E.g.:
am force-stop com.google.android.apps.maps
Or if that doesn't work:
pm disable
- Wait 3 seconds
pm enable
Now, the next question is how to turn off Bluetooth without executing the instructions noted above?
It's quite simple. Make another task.
- Profile Status: BTrern → Off
- Wait 5 seconds
- Bluetooth → Off
Name this task (like BTOFF) and make a shortcut to your home screen.
Now whenever you want to turn off your BT use this shortcut.
Let's make another task that turns on BT as well as the BTrern
- Bluetooth → ON
- Wait 5 sec
- Profile Status → BTrern : ON
Again, use the above two task shortcuts to turn BT ON or OFF.
You can also use a scene or a widget to make it even easier once you have acquired enough knowledge with Tasker..
OLD
I do not quite understand what you mean by Bluetooth share, but I would presume you mean the activity opened by Share → Bluetooth. May be a pic or two would help.
Instead of finding a way around, first try fixing it by:
- Using a Log tool like catlog. (Open catlog → set it on Error, let the crash occur and then open catlog again and save the log.)
- Searching for it. You haven't provided any info about your Android model so you might have to do it yourself.
In case those doesn't work, we can use Tasker. I believe the crash will occur within few seconds of opening the activity. We can use this to our advantage.
Here, qtime is a local variable which stores for how many seconds the task is running. You can find that in Help section of Tasker.
Also you can use Tasker Process Running (KC) for the required process.
Second Method:
Instead of that, it's much more easier to make a Scene instead of that.
With this, there will be a small overlay when you open Bluetooth Share. If it crashes you can easily execute your kill and start command. And if it doesn't crash, the scene will get automatically destroyed after 5 seconds.
May be Bluetooth File transfer can help.