Skip to content

Instantly share code, notes, and snippets.

@baz8080
Created December 15, 2020 13:44
Show Gist options
  • Save baz8080/9108243118b2a93bb447a46870e1e580 to your computer and use it in GitHub Desktop.
Save baz8080/9108243118b2a93bb447a46870e1e580 to your computer and use it in GitHub Desktop.
Workaround for the bug where the conversations icon disappears sometimes.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapplication">
<application
android:name=".MainApplication"
...
android:theme="@style/AppTheme">
<!-- Remember to declare the CustomHelpCenterActivity -->
<activity
android:name=".CustomHelpCenterActivity"
/>
...
</application>
</manifest>
import android.view.Menu;
import android.view.MenuItem;
import zendesk.support.guide.HelpCenterActivity;
// Extend Zendesk's Activity and override onPrepareOptionsMenu to always show the menu.
public class CustomHelpCenterActivity extends HelpCenterActivity {
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
boolean show = super.onPrepareOptionsMenu(menu);
MenuItem conversationsMenuItem = menu.findItem(com.zendesk.guide.sdk.R.id.fragment_help_menu_contact);
if (conversationsMenuItem != null) {
conversationsMenuItem.setVisible(true);
}
return show;
}
}
import zendesk.configurations.Configuration;
import zendesk.support.guide.HelpCenterActivity;
public void launchCustomHelpCenterActivity() {
Intent intent = new Intent(this, CustomHelpCenterActivity.class);
// You can use the Zendesk HelpCenterActivity builder to get a config.
// This config must be passed or else the CustomHelpCenterActivity will
// not open.
Configuration configuration = HelpCenterActivity.builder().config();
intent.putExtra("ZENDESK_CONFIGURATION", configuration);
startActivity(intent);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment