您需要在 zendesk sdk 中使用带有此 activity 的 Theme.AppCompat 主题(或后代)

You need to use a Theme.AppCompat theme (or descendant) with this activity in zendesk sdk

我在我的 android 应用程序中使用外部 activity 的 zendesk SDK

我只是用下面的代码打开它

Intent intent = new Intent(ContactUsActivity.this, ContactZendeskActivity.class);
startActivity(intent);

然后我遇到了以下崩溃

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.forsale.forsale/com.zendesk.sdk.feedback.ui.ContactZendeskActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3149)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3248)
at android.app.ActivityThread.access00(ActivityThread.java:197)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1681)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6872)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(AppCompatDelegateImplV7.java:331)
at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:300)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:264)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:130)
at com.zendesk.sdk.feedback.ui.ContactZendeskActivity.onCreate(ContactZendeskActivity.java:103)
at android.app.Activity.performCreate(Activity.java:6550)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1120)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3102)
... 10 more

谁能告诉我该怎么做?

编辑

我知道我需要在 activity 中使用这个主题,但是 activity 不是我的代码的一部分,它是 zendesk sdk 的一部分,并且没有在我的代码中定义清单文件,我不想在我的整个应用程序中使用这个主题

您可以执行以下两项操作之一:

1) 在你自己的清单

中重新定义activity
<activity
  android:name="com.zendesk.sdk.feedback.ui.ContactZendeskActivity"
  android:label="@string/contact_fragment_title"
  android:windowSoftInputMode="stateVisible|adjustResize"
  android:theme="your_theme" />

2) 将 activity 子类化并在 Activity 中定义样式。