new AsyncTask<Integer, Integer, Integer>(){
@Override
protected void onPreExecute() {
pd=ProgressDialog.show(CasePersonScreen.this, "Please Wait", "Getting Case Persons");
pd.setIndeterminate(true);
}
@Override
protected Integer doInBackground(Integer... params) {
// **Code** performing database operations
CasePersonArryList = objBLParentToChildCommonOperations.getCasePersons(objCase);
return 1;
}
@Override
protected void onPostExecute(Integer arg0) {
if(pd!=null&&pd.isShowing())
{
pd.dismiss();
}
}.execute(1,1,1);
现在进度条开始旋转,当vm执行gc活动时它会被冻结
04-16 18:07:18.760: D/dalvikvm(5993): GC_CONCURRENT freed 2505K, 29% free 18917K/26439K, paused 1ms+7ms
04-16 18:07:19.015: D/dalvikvm(5993): GC_CONCURRENT freed 2048K, 29% free 18917K/26439K, paused 2ms+4ms
04-16 18:07:19.170: D/dalvikvm(5993): GC_CONCURRENT freed 2031K, 29% free 18934K/26439K, paused 2ms+4ms
04-16 18:07:19.325: D/dalvikvm(5993): GC_CONCURRENT freed 2051K, 29% free 18930K/26439K, paused 1ms+4ms
04-16 18:07:19.465: D/dalvikvm(5993): GC_CONCURRENT freed 2051K, 29% free 18926K/26439K, paused 1ms+4ms
04-16 18:07:19.610: D/dalvikvm(5993): GC_CONCURRENT freed 2033K, 29% free 18941K/26439K, paused 1ms+4ms
04-16 18:07:19.750: D/dalvikvm(5993): GC_CONCURRENT freed 2059K, 29% free 18929K/26439K, paused 1ms+4ms
04-16 18:07:19.895: D/dalvikvm(5993): GC_CONCURRENT freed 2046K, 29% free 18930K/26439K, paused 1ms+3ms
04-16 18:07:20.045: D/dalvikvm(5993): GC_CONCURRENT freed 2044K, 29% free 18934K/26439K, paused 2ms+4ms
04-16 18:07:20.205: D/dalvikvm(5993): GC_CONCURRENT freed 2054K, 29% free 18927K/26439K, paused 2ms+3ms
04-16 18:07:20.370: D/dalvikvm(5993): GC_CONCURRENT freed 2033K, 29% free 18941K/26439K, paused 2ms+4ms
04-16 18:07:20.515: D/dalvikvm(5993): GC_CONCURRENT freed 2049K, 29% free 18940K/26439K, paused 2ms+3ms
04-16 18:07:20.655: D/dalvikvm(5993): GC_CONCURRENT freed 2053K, 29% free 18935K/26439K, paused 2ms+4ms
04-16 18:07:20.795: D/dalvikvm(5993): GC_CONCURRENT freed 2032K, 29% free 18950K/26439K, paused 2ms+4ms
04-16 18:07:20.940: D/dalvikvm(5993): GC_CONCURRENT freed 2063K, 29% free 18935K/26439K, paused 2ms+4ms
04-16 18:07:21.085: D/dalvikvm(5993): GC_CONCURRENT freed 2044K, 29% free 18938K/26439K, paused 1ms+4ms
04-16 18:07:21.225: D/dalvikvm(5993): GC_CONCURRENT freed 2051K, 29% free 18935K/26439K, paused 2ms+4ms
04-16 18:07:21.365: D/dalvikvm(5993): GC_CONCURRENT freed 2046K, 29% free 18936K/26439K, paused 2ms+4ms
04-16 18:07:21.540: D/dalvikvm(5993): GC_CONCURRENT freed 2040K, 29% free 18943K/26439K, paused 2ms+4ms
04-16 18:07:21.710: D/dalvikvm(5993): GC_CONCURRENT freed 2039K, 29% free 18951K/26439K, paused 2ms+4ms
04-16 18:07:21.850: D/dalvikvm(5993): GC_CONCURRENT freed 2056K, 29% free 18943K/26439K, paused 1ms+4ms
04-16 18:07:21.995: D/dalvikvm(5993): GC_CONCURRENT freed 2033K, 29% free 18958K/26439K, paused 1ms+4ms
04-16 18:07:22.150: D/dalvikvm(5993): GC_CONCURRENT freed 2051K, 29% free 18955K/26439K, paused 1ms+4ms
04-16 18:07:22.290: D/dalvikvm(5993): GC_CONCURRENT freed 2055K, 29% free 18947K/26439K, paused 1ms+4ms
04-16 18:07:22.460: D/dalvikvm(5993): GC_CONCURRENT freed 2029K, 29% free 18965K/26439K, paused 2ms+3ms
04-16 18:07:22.610: D/dalvikvm(5993): GC_CONCURRENT freed 2060K, 29% free 18953K/26439K, paused 2ms+5ms
04-16 18:07:22.755: D/dalvikvm(5993): GC_CONCURRENT freed 2048K, 29% free 18952K/26439K, paused 1ms+4ms
04-16 18:07:22.900: D/dalvikvm(5993): GC_CONCURRENT freed 2040K, 29% free 18959K/26439K, paused 2ms+5ms
04-16 18:07:23.040: D/dalvikvm(5993): GC_CONCURRENT freed 2056K, 29% free 18951K/26439K, paused 2ms+3ms
04-16 18:07:23.185: D/dalvikvm(5993): GC_CONCURRENT freed 2035K, 29% free 18963K/26439K, paused 2ms+4ms
04-16 18:07:23.325: D/dalvikvm(5993): GC_CONCURRENT freed 2048K, 29% free 18963K/26439K, paused 1ms+4ms
04-16 18:07:23.470: D/dalvikvm(5993): GC_CONCURRENT freed 2050K, 29% free 18961K/26439K, paused 2ms+4ms
04-16 18:07:23.620: D/dalvikvm(5993): GC_CONCURRENT freed 2036K, 29% free 18972K/26439K, paused 2ms+4ms
04-16 18:07:23.760: D/dalvikvm(5993): GC_CONCURRENT freed 2062K, 29% free 18958K/26439K, paused 2ms+3ms
04-16 18:07:23.905: D/dalvikvm(5993): GC_CONCURRENT freed 2045K, 29% free 18960K/26439K, paused 2ms+4ms
04-16 18:07:24.050: D/dalvikvm(5993): GC_CONCURRENT freed 2049K, 29% free 18959K/26439K, paused 1ms+4ms
04-16 18:07:24.195: D/dalvikvm(5993): GC_CONCURRENT freed 2044K, 29% free 18963K/26439K, paused 1ms+4ms
04-16 18:07:24.345: D/dalvikvm(5993): GC_CONCURRENT freed 2040K, 29% free 18970K/26439K, paused 2ms+5ms
04-16 18:07:24.505: D/dalvikvm(5993): GC_CONCURRENT freed 2053K, 29% free 18964K/26439K, paused 2ms+5ms
04-16 18:07:24.675: D/dalvikvm(5993): GC_CONCURRENT freed 2040K, 29% free 18971K/26439K, paused 1ms+5ms
04-16 18:07:24.840: D/dalvikvm(5993): GC_CONCURRENT freed 2047K, 29% free 18972K/26439K, paused 2ms+5ms
04-16 18:07:25.005: D/dalvikvm(5993): GC_CONCURRENT freed 2039K, 29% free 18981K/26439K, paused 2ms+3ms
04-16 18:07:25.150: D/dalvikvm(5993): GC_CONCURRENT freed 2056K, 29% free 18972K/26439K, paused 1ms+4ms
04-16 18:07:25.290: D/dalvikvm(5993): GC_CONCURRENT freed 2033K, 29% free 18987K/26439K, paused 2ms+4ms
04-16 18:07:25.440: D/dalvikvm(5993): GC_CONCURRENT freed 2050K, 29% free 18984K/26439K, paused 2ms+5ms
04-16 18:07:25.595: D/dalvikvm(5993): GC_CONCURRENT freed 2054K, 29% free 18978K/26439K, paused 2ms+4ms
04-16 18:07:25.740: D/dalvikvm(5993): GC_CONCURRENT freed 2034K, 29% free 18992K/26439K, paused 1ms+4ms
04-16 18:07:25.885: D/dalvikvm(5993): GC_CONCURRENT freed 2059K, 29% free 18980K/26439K, paused 1ms+4ms
04-16 18:07:26.025: D/dalvikvm(5993): GC_CONCURRENT freed 2048K, 29% free 18980K/26439K, paused 2ms+3ms
04-16 18:07:26.170: D/dalvikvm(5993): GC_CONCURRENT freed 2050K, 29% free 18977K/26439K, paused 2ms+4ms
04-16 18:07:26.315: D/dalvikvm(5993): GC_CONCURRENT freed 2043K, 29% free 18982K/26439K, paused 1ms+4ms
04-16 18:07:26.455: D/dalvikvm(5993): GC_CONCURRENT freed 2044K, 29% free 18986K/26439K, paused 1ms+4ms
04-16 18:07:26.600: D/dalvikvm(5993): GC_CONCURRENT freed 2039K, 29% free 18994K/26439K, paused 2ms+5ms
04-16 18:07:26.745: D/dalvikvm(5993): GC_CONCURRENT freed 2057K, 29% free 18984K/26439K, paused 2ms+4ms
04-16 18:07:26.890: D/dalvikvm(5993): GC_CONCURRENT freed 2033K, 29% free 18999K/26439K, paused 2ms+4ms
04-16 18:07:27.040: D/dalvikvm(5993): GC_CONCURRENT freed 2050K, 29% free 18997K/26439K, paused 1ms+4ms
04-16 18:07:27.195: D/dalvikvm(5993): GC_CONCURRENT freed 2056K, 29% free 18988K/26439K, paused 2ms+4ms
04-16 18:07:27.335: D/dalvikvm(5993): GC_CONCURRENT freed 2030K, 29% free 19005K/26439K, paused 1ms+4ms
04-16 18:07:27.480: D/dalvikvm(5993): GC_CONCURRENT freed 2060K, 29% free 18993K/26439K, paused 1ms+4ms
04-16 18:07:27.625: D/dalvikvm(5993): GC_CONCURRENT freed 2046K, 29% free 18994K/26439K, paused 2ms+4ms
04-16 18:07:27.770: D/dalvikvm(5993): GC_CONCURRENT freed 2050K, 29% free 18992K/26439K, paused 1ms+4ms
04-16 18:07:27.915: D/dalvikvm(5993): GC_CONCURRENT freed 2045K, 29% free 18994K/26439K, paused 1ms+4ms
04-16 18:07:28.060: D/dalvikvm(5993): GC_CONCURRENT freed 2042K, 29% free 19000K/26439K, paused 2ms+4ms
04-16 18:07:28.205: D/dalvikvm(5993): GC_CONCURRENT freed 2044K, 29% free 19003K/26439K, paused 2ms+4ms
04-16 18:07:28.355: D/dalvikvm(5993): GC_CONCURRENT freed 2055K, 29% free 18996K/26439K, paused 1ms+4ms
04-16 18:07:28.510: D/dalvikvm(5993): GC_CONCURRENT freed 2034K, 29% free 19009K/26439K, paused 2ms+4ms
04-16 18:07:28.655: D/dalvikvm(5993): GC_CONCURRENT freed 2049K, 29% free 19008K/26439K, paused 2ms+3ms
04-16 18:07:28.800: D/dalvikvm(5993): GC_CONCURRENT freed 2050K, 29% free 19006K/26439K, paused 2ms+5ms
04-16 18:07:28.945: D/dalvikvm(5993): GC_CONCURRENT freed 2038K, 29% free 19014K/26439K, paused 1ms+4ms
04-16 18:07:29.090: D/dalvikvm(5993): GC_CONCURRENT freed 2060K, 29% free 19002K/26439K, paused 1ms+4ms
04-16 18:07:29.240: D/dalvikvm(5993): GC_CONCURRENT freed 2043K, 29% free 19007K/26439K, paused 2ms+5ms
04-16 18:07:29.395: D/dalvikvm(5993): GC_CONCURRENT freed 2053K, 29% free 19002K/26439K, paused 2ms+3ms
04-16 18:07:29.540: D/dalvikvm(5993): GC_CONCURRENT freed 2043K, 29% free 19006K/26439K, paused 1ms+5ms
04-16 18:07:29.680: D/dalvikvm(5993): GC_CONCURRENT freed 2045K, 29% free 19008K/26439K, paused 1ms+3ms
04-16 18:07:29.825: D/dalvikvm(5993): GC_CONCURRENT freed 2041K, 29% free 19015K/26439K, paused 2ms+3ms
04-16 18:07:29.970: D/dalvikvm(5993): GC_CONCURRENT freed 2050K, 29% free 19012K/26439K, paused 2ms+3ms
04-16 18:07:30.115: D/dalvikvm(5993): GC_CONCURRENT freed 2038K, 29% free 19022K/26439K, paused 2ms+4ms
04-16 18:07:30.255: D/dalvikvm(5993): GC_CONCURRENT freed 2053K, 29% free 19016K/26439K, paused 1ms+3ms
04-16 18:07:30.400: D/dalvikvm(5993): GC_CONCURRENT freed 2043K, 29% free 19021K/26439K, paused 1ms+5ms
04-16 18:07:30.545: D/dalvikvm(5993): GC_CONCURRENT freed 2045K, 29% free 19024K/26439K, paused 1ms+4ms
04-16 18:07:30.690: D/dalvikvm(5993): GC_CONCURRENT freed 2042K, 29% free 19029K/26439K, paused 1ms+4ms
请帮我解决这个问题
先谢谢
答案 0 :(得分:0)
您可能在主线程中执行了一项繁重的任务,导致UI卡住。你可以发布你的整个主要活动吗?