我正在处理的应用程序存在一个非常奇怪的问题。启动应用后,它会调用Activity A
,然后调用Activity B
。在Activity B
中,我重写了调用函数的onKeyDown方法,如下所示:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if (keyCode == KeyEvent.KEYCODE_BACK)
{
disconnectDatabase();
}
else if (keyCode == KeyEvent.KEYCODE_DEL)
{
QueryEditor queryEditor = (QueryEditor) getSupportFragmentManager().findFragmentById(R.id.fragment_queryEditor);
queryEditor.formatQueryText();
}
return super.onKeyDown(keyCode, event);
}
disconnectDatabase
功能如下:
private void disconnectDatabase()
{
UserInterfaceManager uiManager = new UserInterfaceManager(ConnectedDBManagerHost.this);
if (uiManager.showYesNoDialog(getString(R.string.are_you_sure_you_want_to_disconnect_the_current_database), getString(R.string.are_you_sure), false))
{
ConnectionsManager.connectedDatabase = null;
Intent intent = new Intent(this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
finish();
startActivity(intent);
}
}
showYesNoDialog
方法构建一个AlertDialog并返回用户按下的结果。这正确加载,我按下是然后它崩溃,但崩溃不是来自我的应用程序,而是似乎来自平板电脑的硬件,通过它的图形驱动程序的外观。
logcat中显示的错误如下:
8-06 22:41:47.122 28777-28777/com.BoardiesITSolutions.MysqlManager E/tegra_memtrack_hal: Error: Could not find any nvmap heaps.
08-06 22:41:47.123 28777-28777/com.BoardiesITSolutions.MysqlManager E/tegra_memtrack_hal: Error: Could not find any nvmap heaps.
08-06 22:41:47.123 28777-28777/com.BoardiesITSolutions.MysqlManager E/tegra_memtrack_hal: Error: Could not find any nvmap heaps.
08-06 22:41:48.582 28777-28777/com.BoardiesITSolutions.MysqlManager E/Ads: JS: Uncaught ReferenceError: AFMA_ReceiveMessage is not defined (:1)
08-06 22:41:53.891 29187-28777/? A/google-breakpad: -----BEGIN BREAKPAD MICRODUMP-----
08-06 22:41:53.891 29187-28777/? A/google-breakpad: V WebView:51.0.2704.81
08-06 22:41:53.893 29187-28777/? A/google-breakpad: O A arm64 02 aarch64 google/volantis/flounder:6.0.1/MOB30P/2960889:user/release-keys
08-06 22:41:53.893 29187-28777/? A/google-breakpad: G OpenGL ES 3.1 NVIDIA 343.00|NVIDIA Corporation|NVIDIA Tegra
08-06 22:41:53.893 29187-28777/? A/google-breakpad: S 0 0000007FC76151A0 0000007FC7615000 0000000000002000
08-06 22:41:53.896 29187-28777/? A/google-breakpad: S 0000007FC7615000 101ABAC7550000004B5161C77F0000004C5161C77F0000000000430001000000008911C755000000B668
仅供参考我没有包含整个logcat,它看起来主要只是一个内存转储。
由于这次崩溃不是来自我的应用程序,我完全不知道在哪里寻找或导致这种情况。我没有打电话给新的活动,而是尝试过调用完,但没有任何区别。它也不会一直这样做,它确实在大多数时间都这样做,但偶尔它会完美地工作。