0
试图从静态函数调用?其初始化,因为它从该活动的onCreate调用。想知道crashlytics是如何工作的。它是否需要引用某种不存在的上下文。下面是一些代码:Crashlytics不被称为?
从活动菜单覆盖呼唤:
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
switch(item.getItemId())
{
case R.id.explore:
ListFragment.injectNewList(ListActivity.this, Stuff.getRandOffset());
break;
default:
break;
}
return true;
}
调用函数是一个片段内的静态函数:
public static void injectNewList(FragmentActivity activity, Integer offset)
{
ListFragment fragment = (ListFragment) activity.getSupportFragmentManager()
.findFragmentByTag(BaseFragmentActivity.LIST_FRAGMENT_TAG);
if(fragment != null)
{
fragment.nextOffset = offset;
FFData.getInstance().clearList();
fragment.mListAdapter.notifyDataSetInvalidated();
fragment.loadItems();
}
else
{
Crashlytics.log(Log.ERROR, "Log this error", "bad stuff happened!");
}
}
活动和片段完全运行时,菜单按钮被点击。我也看到代码在调试器中运行。在genymotion运行(会尽量实际设备),SDK 19,Nexus5