我正在尝试导入This项目,而不是正确导入我的红线(项目名称是actionbarcompat)。
private ActionBar getActionBar(Activity activity) {
if (activity instanceof ActionBarActivity) {
return ((ActionBarActivity) activity).getSupportActionBar();
}
ActionBar actionBar = getActionBarWithReflection(activity, "getSupportActionBar");
if (actionBar == null) {
throw new RuntimeException("Activity should derive from ActionBarActivity "
+ "or implement a method called getSupportActionBar");
}
return actionBar;
}
基于此行Activity should derive from ActionBarActivity "
+ "or implement a method called getSupportActionBar
我假设我无法检测到动作栏。
任何形式的帮助。