Stereo play back for Android 12
- By imbuildr
- Ask a question
- 6 Replies
How do I enable stereo playback in android 12. Bluethooth speakers only playing left channel.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
private val dataViewModel : DataViewModel by activityViewModels {
DataViewModelFactory()
}
fun submitToDb(f_name: String, l_name: String, a_name: String, role: String){
val newClient = Client(0, f_name, l_name, role, a_name)
Log.d("Insert Client", "Start")
dataViewModel.insertClient(newClient)
Log.d("Insert Client", "Finished")
}
override fun onDetach() {
super.onDetach()
Log.d("WelcomeFragment", "On detach")
}
class DataViewModelFactory(): ViewModelProvider.Factory {
override fun <T: ViewModel> create(modelClass: Class<T>, extras: CreationExtras): T {
val application = checkNotNull(extras[APPLICATION_KEY])
if(modelClass.isAssignableFrom(DataViewModel::class.java)){
@Suppress("UNCHECKED_CAST")
return DataViewModel(
(application as PawsApplication).repository
) as T
}
throw IllegalArgumentException("Unknown ViewModel class")
}
}
FATAL EXCEPTION: main
Process: com.miriam.helpingpaws, PID: 2622
java.lang.IllegalStateException: Fragment WelcomeFragment{276ac35} (3be3fa8f-b72d-45e4-b0b3-4ae1274d8df2) not attached to an activity.
at androidx.fragment.app.Fragment.requireActivity(Fragment.java:1000)
at com.miriam.helpingpaws.welcome.WelcomeFragment.submitToDb(WelcomeFragment.kt:70)
at com.miriam.helpingpaws.welcome.WelcomeScreenKt$WelcomeScreen$1$5.invoke(WelcomeScreen.kt:86)
at com.miriam.helpingpaws.welcome.WelcomeScreenKt$WelcomeScreen$1$5.invoke(WelcomeScreen.kt:86)
at androidx.compose.foundation.ClickableKt$clickable$4$gesture$1$1$2.invoke-k-4lQ0M(Clickable.kt:167)
at androidx.compose.foundation.ClickableKt$clickable$4$gesture$1$1$2.invoke(Clickable.kt:156)
at androidx.compose.foundation.gestures.TapGestureDetectorKt$detectTapAndPress$2$1$1.invokeSuspend(TapGestureDetector.kt:234)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:566)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.dispatchPointerEvent(SuspendingPointerInputFilter.kt:456)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:469)
at androidx.compose.ui.node.BackwardsCompatNode.onPointerEvent-H0pRuoY(BackwardsCompatNode.kt:394)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:314)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:183)
at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:102)
at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:98)
at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1329)
at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1275)
at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1214)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
2023-06-23 14:13:54.849 2622-2622 AndroidRuntime com.miriam.helpingpaws E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:502)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1890)
at android.app.Activity.dispatchTouchEvent(Activity.java:4199)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:70)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:460)
at android.view.View.dispatchPointerEvent(View.java:14858)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6446)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6247)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5725)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5913)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5756)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5970)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5729)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5756)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5729)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8696)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8647)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8616)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8819)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:259)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:335)
at android.os.Looper.loopOnce(Looper.java:161)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7842)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@8b58796, androidx.compose.runtime.BroadcastFrameClock@89e9f17, StandaloneCoroutine{Cancelling}@2ccef04, AndroidUiDispatcher@32d2ced]
I isNFCAllowed is called for userId - 0
D NFC checking for 0
W container manager null for 0
I allow NFC for 0
D call the applyRouting
I [INFO:NativeNfcManager.cpp(2044)] nfcManager_enableDiscovery: enter
I [INFO:NativeNfcManager.cpp(4265)] storeLastDiscoveryParams: enter
I [INFO:NativeNfcManager.cpp(2083)] nfcManager_enableDiscovery: enter; tech_mask = 01, restart = 1
I [INFO:NativeNfcManager.cpp(3974)] startRfDiscovery: is start=0
I [INFO:NativeNfcManager.cpp(572)] nfaConnectionCallback: event= 31
I [INFO:NativeNfcManager.cpp(610)] nfaConnectionCallback: NFA_RF_DISCOVERY_STOPPED_EVT: status = 0
I [INFO:NativeNfcManager.cpp(4191)] stopPolling_rfDiscoveryDisabled: disable polling
I [INFO:NativeNfcManager.cpp(572)] nfaConnectionCallback: event= 1
I [INFO:NativeNfcManager.cpp(590)] nfaConnectionCallback: NFA_POLL_DISABLED_EVT: status = 0
I [INFO:NativeNfcManager.cpp(4169)] startPolling_rfDiscoveryDisabled: enable polling
I [INFO:NativeNfcManager.cpp(4173)] startPolling_rfDiscoveryDisabled: wait for enable event
I [INFO:NativeNfcManager.cpp(572)] nfaConnectionCallback: event= 0
I [INFO:NativeNfcManager.cpp(581)] nfaConnectionCallback: NFA_POLL_ENABLED_EVT: status = 0
I [INFO:NativeNfcManager.cpp(2115)] nfcManager_enableDiscovery: Enable p2pListening
I [INFO:NativeNfcManager.cpp(3974)] startRfDiscovery: is start=1
I [INFO:NativeNfcManager.cpp(572)] nfaConnectionCallback: event= 37
I [INFO:NativeNfcManager.cpp(1030)] nfaConnectionCallback: unknown event ????
I [INFO:NativeNfcManager.cpp(572)] nfaConnectionCallback: event= 30
I [INFO:NativeNfcManager.cpp(600)] nfaConnectionCallback: NFA_RF_DISCOVERY_STARTED_EVT: status = 0
I [INFO:NativeNfcManager.cpp(4128)] startStopPolling: enter; isStart=1
I [INFO:NativeNfcManager.cpp(1193)] nfaDeviceManagementCallback: enter; event=0x2
I [INFO:NativeNfcManager.cpp(1222)] nfaDeviceManagementCallback: NFA_DM_SET_CONFIG_EVT
I [INFO:NativeNfcManager.cpp(4156)] startStopPolling: exit
I [INFO:NativeNfcManager.cpp(2190)] nfcManager_enableDiscovery: exit
I Notify nfc service : camera open was(true) -> now(false) = polling(false)
D call the applyRouting
I [INFO:NativeNfcManager.cpp(2044)] nfcManager_enableDiscovery: enter
I [INFO:NativeNfcManager.cpp(4265)] storeLastDiscoveryParams: enter
I [INFO:NativeNfcManager.cpp(2083)] nfcManager_enableDiscovery: enter; tech_mask = 00, restart = 1
I [INFO:NativeNfcManager.cpp(3974)] startRfDiscovery: is start=0
I [INFO:NativeNfcManager.cpp(572)] nfaConnectionCallback: event= 31
I [INFO:NativeNfcManager.cpp(610)] nfaConnectionCallback: NFA_RF_DISCOVERY_STOPPED_EVT: status = 0
I [INFO:NativeNfcManager.cpp(4191)] stopPolling_rfDiscoveryDisabled: disable polling
I [INFO:NativeNfcManager.cpp(572)] nfaConnectionCallback: event= 1
I [INFO:NativeNfcManager.cpp(590)] nfaConnectionCallback: NFA_POLL_DISABLED_EVT: status = 0
I [INFO:NativeNfcManager.cpp(3974)] startRfDiscovery: is start=1
I [INFO:NativeNfcManager.cpp(572)] nfaConnectionCallback: event= 30
I [INFO:NativeNfcManager.cpp(600)] nfaConnectionCallback: NFA_RF_DISCOVERY_STARTED_EVT: status = 0
I [INFO:NativeNfcManager.cpp(2190)] nfcManager_enableDiscovery: exit
D call the applyRouting
D Discovery configuration equal, not updating.
I Notify nfc service : camera open was(false) -> now(true) = polling(true)
D call the applyRouting
I [INFO:NativeNfcManager.cpp(2044)] nfcManager_enableDiscovery: enter
I [INFO:NativeNfcManager.cpp(4265)] storeLastDiscoveryParams: enter
I [INFO:NativeNfcManager.cpp(2083)] nfcManager_enableDiscovery: enter; tech_mask = 2f, restart = 1
I [INFO:NativeNfcManager.cpp(3974)] startRfDiscovery: is start=0
I [INFO:NativeNfcManager.cpp(572)] nfaConnectionCallback: event= 31
I [INFO:NativeNfcManager.cpp(610)] nfaConnectionCallback: NFA_RF_DISCOVERY_STOPPED_EVT: status = 0
I [INFO:NativeNfcManager.cpp(4191)] stopPolling_rfDiscoveryDisabled: disable polling
I [INFO:NativeNfcManager.cpp(572)] nfaConnectionCallback: event= 1
I [INFO:NativeNfcManager.cpp(590)] nfaConnectionCallback: NFA_POLL_DISABLED_EVT: status = 3
I [INFO:NativeNfcManager.cpp(4169)] startPolling_rfDiscoveryDisabled: enable polling
I [INFO:NativeNfcManager.cpp(4173)] startPolling_rfDiscoveryDisabled: wait for enable event
I [INFO:NativeNfcManager.cpp(572)] nfaConnectionCallback: event= 0
I [INFO:NativeNfcManager.cpp(581)] nfaConnectionCallback: NFA_POLL_ENABLED_EVT: status = 0
I [INFO:NativeNfcManager.cpp(2115)] nfcManager_enableDiscovery: Enable p2pListening
I [INFO:NativeNfcManager.cpp(3974)] startRfDiscovery: is start=1
I [INFO:NativeNfcManager.cpp(572)] nfaConnectionCallback: event= 36
I [INFO:NativeNfcManager.cpp(1009)] nfaConnectionCallback: NFA_LISTEN_ENABLED_EVT : status=0x0
I [INFO:NativeNfcManager.cpp(1193)] nfaDeviceManagementCallback: enter; event=0x2
I [INFO:NativeNfcManager.cpp(1222)] nfaDeviceManagementCallback: NFA_DM_SET_CONFIG_EVT
I [INFO:NativeNfcManager.cpp(572)] nfaConnectionCallback: event= 30
I [INFO:NativeNfcManager.cpp(600)] nfaConnectionCallback: NFA_RF_DISCOVERY_STARTED_EVT: status = 0
I [INFO:NativeNfcManager.cpp(4128)] startStopPolling: enter; isStart=1
I [INFO:NativeNfcManager.cpp(1193)] nfaDeviceManagementCallback: enter; event=0x2
I [INFO:NativeNfcManager.cpp(1222)] nfaDeviceManagementCallback: NFA_DM_SET_CONFIG_EVT
I [INFO:NativeNfcManager.cpp(4156)] startStopPolling: exit
I [INFO:NativeNfcManager.cpp(2190)] nfcManager_enableDiscovery: exit