在android中,我正在编写一个单击按钮的文件,并在下次单击时,它保存文件并关闭缓冲的编写器.但是,我还希望在onDestroy函数中实现关闭缓冲编写器的功能.在此之前,我需要知道是否Bufferedwriter
已经关闭.我如何检查Buffered Writer是否已经关闭?
除此之外,bufferedWriter.close()
功能设置bufferedWriter
为null
?
以下是android代码片段
\n\nrunOnUiThread(new Runnable() {\n public void run() {\n AlertDialog alertDialog;\n alertDialog = new AlertDialog.Builder(MainActivity.this).create();\n alertDialog.setTitle("Network error");\n alertDialog.setMessage("Disconnected");\n alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, "ok", new DialogInterface.OnClickListener() {\n /** ON clicking oKay button **/\n public void onClick(DialogInterface dialog, int id)\n {\n\n hasConnectServiceStarted = false;\n IP = null;\n// Intent intent = getIntent();\n Intent intentSplash = new Intent(getApplication().getApplicationContext(), SplashActivity.class);\n\n /** Shutdown the nodemain executor service if\n * HOST goes down\n */\n nodeMainExecutorService.forceShutdown();\n /** and restart the Main Activity that will prompt\n * user to reconnect to the …
Run Code Online (Sandbox Code Playgroud) 是什么
this statement may fall through [-Werror=implicit-fallthrough=]
Run Code Online (Sandbox Code Playgroud)
意思 ?
我在这样的语句编译时收到此错误:
switch(eT)
{
case SEL_CRIT:
{
TYPE1* psSel;
iRetVal = dbseq(enB->m_ps,
NULL, NULL, &esM, NULL, ESEC);
while (iRetVal == 0)
{
if(psEnterprise)
{
bool iFound = false;
for (i = 0; i< psME->m_pslave[0].m_uc; i++)
{
ENT node1;
sEOS = psME>m_pslave[0].m_pslavecnt[i];
}
if (iFound && (psME->m_NOTOVERLOADED == false))
{
return psME;
}
}
}
psSel = (M_EN*)pCrit;
LOG_INFO(FAIL_TO_LOAD, psME->m_ONG, psME->EN);
int_Enterprise = NULL;
}
Run Code Online (Sandbox Code Playgroud)
在
int_Enterprise = NULL;
Run Code Online (Sandbox Code Playgroud)
哪里
int_Enterprise是某种结构指针。
我怎样才能解决这个问题?