我想将 Instabug 与旧版本的支持库 (appcompat-v7/support-v4) 一起使用,因为我们的应用程序尚未准备好使用 Material design。但是,当我使用 InstabugAppCompatActivity
(或任何其他类型)时,由于将较新的支持库链接到 com.instabug.library.instabugsupport
,我将 Material 设计引入到我的应用程序中。
有什么想法如何做到这一点吗?谢谢
最佳答案
您可以使用此包含(或更新版本的instabugbasic):compile 'com.instabug.library:instabugbasic:1.3.8'
然后,您需要创建扩展 ActionBarActivity 的 InstabugActivity 并重写一些方法。
public class BaseInstabugActivity extends ActionBarActivity {
InstabugActivityDelegate mDelegate;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mDelegate = new InstabugActivityDelegate(this);
}
@Override
protected void onResume() {
super.onResume();
mDelegate.onResume();
}
@Override
protected void onPause() {
super.onPause();
mDelegate.onPause();
}
@Override
protected void onDestroy() {
super.onDestroy();
mDelegate.onDestroy();
}
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
mDelegate.dispatchTouchEvent(ev);
return super.dispatchTouchEvent(ev);
} }
其余集成与官方指南相同。因此,不要忘记在 Application 类中初始化 Instabug 并将 InstabugFeedbackActivity 添加到 list 中。也许您需要在 list 中使用自己的 android:theme 和 InstabugFeedbackActivity。
关于android - 如何将 Instabug 与较旧的支持库和 Holo 主题一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31605643/