Audio/Video Call Issue+++

  1. How do I return to the ongoing call , when I exit from that activity. As of now, I don’t see any such option. I have to force close the application.

  2. theme-related issues.

  3. java.lang.NullPointerException: Attempt to invoke virtual method ‘java.lang.String com.cometchat.pro.models.User.getUid()’ on a null object reference(AllCall.java:109).

These are the issues I am facing, hoping for your valuable reply.

Thanks!

Hello @PranavKapadne

For this you can use the CometChat.getActiveCall() method provided buy the SDK. This method returns the sessionId of the the call that is ongoing. If there is no ongoing call it will return null. To join the already ongoing call, just call the CometChat.startCall() method and pass the sessionId of the call obtained from the getActiveCall() method.

Can you please elaborate on this and let us know the issue you are facing in a little detail so that we can help you out with this.

I would like some more information on this too as to when you get this error and also can you please provide me with the complete stacktrace for this error.

Awaiting Reply.
Thank you

Error1--------->theme-related issues.

Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:696)
at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:659)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:552)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:303)
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:284)
at screen.unified.CometChatUnified.onCreate(CometChatUnified.java:92)
Above error is while starting CometChatUnified Activity.

Error 2------------>:java.lang.NullPointerException: Attempt to invoke virtual method ‘java.lang.String com.cometchat.pro.models.User.getUid()’ on a null object reference( AllCall.java:109 )

This Exception is while placing a call from list of contacts in Activity showing --Missed calls/All Fields are Mandatory

Error 3: Toast appears saying Unable to end call This happens sometimes

Below is my AppTheme

<style name="AppBaseTheme" parent="@android:style/Theme.Light">
    <item name="android:windowActionBar">true</item>
    <item name="android:windowDisablePreview">true</item>
    <item name="android:actionBarSize">@dimen/actionbar_height</item>
    <item name="actionBarSize">@dimen/actionbar_height</item>
</style>

<style name="AppTheme" parent="AppBaseTheme">

Theme.Light

<style name="Theme.Light">
    <item name="isLightTheme">true</item>
    <item name="windowBackground">@drawable/screen_background_selector_light</item>
    <item name="windowClipToOutline">false</item>

    <item name="colorBackground">@color/background_light</item>
    <item name="colorForeground">@color/bright_foreground_light</item>
    <item name="colorForegroundInverse">@color/bright_foreground_light_inverse</item>

    <item name="colorPrimaryDark">@color/legacy_light_primary_dark</item>
    <item name="colorPrimary">@color/legacy_light_primary</item>
    <item name="colorControlActivated">@color/legacy_light_control_activated</item>
    <item name="colorControlNormal">@color/legacy_light_control_normal</item>
    <item name="colorControlHighlight">@color/legacy_light_button_pressed</item>
    <item name="colorButtonNormal">@color/legacy_light_button_normal</item>

    <item name="textColorPrimary">@color/primary_text_light</item>
    <item name="textColorSecondary">@color/secondary_text_light</item>
    <item name="textColorTertiary">@color/tertiary_text_light</item>
    <item name="textColorPrimaryInverse">@color/primary_text_dark</item>
    <item name="textColorSecondaryInverse">@color/secondary_text_dark</item>
    <item name="textColorTertiaryInverse">@color/tertiary_text_dark</item>
    <item name="textColorPrimaryActivated">@color/primary_text_light</item>
    <item name="textColorSecondaryActivated">@color/secondary_text_light</item>
    <item name="textColorPrimaryDisableOnly">@color/primary_text_light_disable_only</item>
    <item name="textColorPrimaryInverseDisableOnly">@color/primary_text_dark_disable_only</item>
    <item name="textColorPrimaryNoDisable">@color/primary_text_light_nodisable</item>
    <item name="textColorSecondaryNoDisable">@color/secondary_text_light_nodisable</item>
    <item name="textColorPrimaryInverseNoDisable">@color/primary_text_dark_nodisable</item>
    <item name="textColorSecondaryInverseNoDisable">@color/secondary_text_dark_nodisable</item>
    <item name="textColorHint">@color/hint_foreground_light</item>
    <item name="textColorHintInverse">@color/hint_foreground_dark</item>
    <item name="textColorHighlight">@color/highlighted_text_light</item>
    <item name="textColorHighlightInverse">@color/highlighted_text_dark</item>
    <item name="textColorLink">@color/link_text_light</item>
    <item name="textColorLinkInverse">@color/link_text_dark</item>

    <item name="editTextColor">@color/primary_text_light</item>
    <item name="listChoiceBackgroundIndicator">@drawable/list_selector_background</item>

    <item name="activatedBackgroundIndicator">@drawable/activated_background_light</item>
    <item name="quickContactBadgeOverlay">@drawable/quickcontact_badge_overlay_light</item>

    <item name="popupWindowStyle">@style/Widget.PopupWindow</item>

    <item name="textCheckMark">@drawable/indicator_check_mark_light</item>
    <item name="textCheckMarkInverse">@drawable/indicator_check_mark_dark</item>

    <item name="gestureOverlayViewStyle">@style/Widget.GestureOverlayView.White</item>
    <item name="expandableListViewStyle">@style/Widget.ExpandableListView.White</item>
    <item name="listViewStyle">@style/Widget.ListView.White</item>
    <item name="listDivider">@drawable/divider_horizontal_bright</item>
    <item name="listSeparatorTextViewStyle">@style/Widget.TextView.ListSeparator.White</item>

    <item name="progressBarStyle">@style/Widget.ProgressBar.Inverse</item>
    <item name="progressBarStyleSmall">@style/Widget.ProgressBar.Small.Inverse</item>
    <item name="progressBarStyleLarge">@style/Widget.ProgressBar.Large.Inverse</item>
    <item name="progressBarStyleInverse">@style/Widget.ProgressBar</item>
    <item name="progressBarStyleSmallInverse">@style/Widget.ProgressBar.Small</item>
    <item name="progressBarStyleLargeInverse">@style/Widget.ProgressBar.Large</item>
    <item name="actionModeCutDrawable">@drawable/ic_menu_cut_holo_light</item>
    <item name="actionModeCopyDrawable">@drawable/ic_menu_copy_holo_light</item>
    <item name="actionModePasteDrawable">@drawable/ic_menu_paste_holo_light</item>
    <item name="actionModeSelectAllDrawable">@drawable/ic_menu_selectall_holo_light</item>
    <item name="actionModeShareDrawable">@drawable/ic_menu_share_holo_light</item>
    <item name="actionModeFindDrawable">@drawable/ic_menu_find_holo_light</item>
    <item name="actionModeWebSearchDrawable">@drawable/ic_menu_search_holo_light</item>
    <item name="actionModeBackground">@drawable/cab_background_top_holo_light</item>
    <item name="actionModeSplitBackground">@drawable/cab_background_bottom_holo_light</item>

    <item name="searchViewStyle">@style/Widget.Holo.Light.SearchView</item>
    <item name="detailsElementBackground">@drawable/panel_bg_holo_light</item>

    <item name="mediaRouteButtonStyle">@style/Widget.DeviceDefault.Light.MediaRouteButton</item>
    <item name="findOnPageNextDrawable">@drawable/ic_find_next_holo_light</item>
    <item name="findOnPagePreviousDrawable">@drawable/ic_find_previous_holo_light</item>

    <!-- Floating toolbar styles -->
    <item name="floatingToolbarCloseDrawable">@drawable/ic_ab_back_material_light</item>
    <item name="floatingToolbarForegroundColor">@color/foreground_material_light</item>
    <item name="floatingToolbarItemBackgroundBorderlessDrawable">@drawable/item_background_borderless_material_light</item>
    <item name="floatingToolbarItemBackgroundDrawable">@drawable/item_background_material_light</item>
    <item name="floatingToolbarOpenDrawable">@drawable/ic_menu_moreoverflow_material_light</item>
    <item name="floatingToolbarPopupBackgroundDrawable">@drawable/floating_popup_background_light</item>
    <item name="floatingToolbarDividerColor">@color/floating_popup_divider_light</item>

    <!-- Tooltip popup colors -->
    <item name="tooltipForegroundColor">@color/bright_foreground_dark</item>
    <item name="tooltipBackgroundColor">@color/tooltip_background_dark</item>
</style>

Hi @PranavKapadne,

You need to use the Theme.MaterialComponent in your app to use UI Kit. As the UI Kit is built on the latest version and it requires this theme.

Please add the following dependency in your (app level) build gradle

dependencies {
  implementation 'com.google.android.material:material:1.2.0-alpha04'
} 

And please make the below-mentioned changes in your style.xml

<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar.Bridge">

    <!-- Customize your theme here. -->

    </style>

Visit our documentation to know more about UI Kit.

You can visit the below mentioned link to know about Material Theme.
https://developer.android.com/guide/topics/ui/look-and-feel

Yes,I have implemented what you said, also tried below code but didnt work…**

      <style name="AppBaseTheme" 
     parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
    <item name="android:windowActionBar">true</item>
    <item name="android:windowDisablePreview">true</item>
    <item name="android:actionBarSize">@dimen/actionbar_height</item>
    <item name="actionBarSize">@dimen/actionbar_height</item>
</style>
<!-- Base application theme. -->
<style name="AppThemeMenu" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="android:windowActionBar">true</item>
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">

Hello @PranavKapadne
Can you also change the theme with name “AppThemeMenu” to extend
Theme.MaterialComponents.Light.NoActionBar.Bridge

@aditya.gokula Hey, its not working.

Hello @PranavKapadne
Can you please share the styles.xml and the AndroidManifest.xml files with us so that we can put this in a dummy project at our end and check this at our end.

Thanks

Link to Manifest.xml and Styles.xml

Problem1---->

This message pops up whenever I place/receive a video call on my Oneplus 6T.

Problem2----> The app crashes while placing a call from the missed call list. The exception is java.lang.NullPointerException: Attempt to invoke virtual method ‘java.lang.String com.cometchat.pro.models.User.getUid()’ on a null object reference(AllCall.java:109).

Problem3-----> Sometimes I cannot end the call, I have to forcefully close the application. I see a toast saying Unable to end call.

Hi @PranavKapadne,

We suggest you to refer our latest UI Kit. These issues are fixed in our latest UI Kit & SDK which is included in the below Sample App.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.