记忆似乎是一个很大的话题,我找不到具体的答案.我已经得到了堆中有多少可用的答案,我知道应该使用多少.我需要答案如何编码以编程方式确定我的应用程序使用堆的内存量是多少?我使用的总内存是多少?
我AsyncTask跑了.我有一个TextView模仿Toast最初产生的信息.我希望明确TextView成功OnPostExecute但不会这样做.任务完成Toast工作正常.如何设置TextView的OnPostExecute空白?用户仍然在显示屏上TextView.
错误情况的代码如下:
@Override
protected void onPostExecute(Void result)
{ FetchingImage=0;
if(webLoadError>0)
{
TextView text = (TextView) findViewById(R.id.textView2);
String temp=" ";
text.setText(temp);
Toast.makeText(getApplicationContext(), "Image not available from the internet.\nDefault or last image loaded.\nTry again later.",Toast.LENGTH_LONG).show();
}
}
Run Code Online (Sandbox Code Playgroud)