我的应用程序中有一些图像在 sd 卡上,我想在一段时间内将这些图像一张一张地显示给用户,让我们说一张图像,然后在一分钟后另一张图像,然后一分钟后另一张图像,就像这样。我正在使用 aysnctask我在其中将图像转换为位图并显示它。我想在连续循环中显示这些图像,直到用户从应用程序中存在应用程序应该一张一张地显示图像我正在使用以下代码:-
for(i=1;i<z-1;i++)
{
xc=cont_id.get(1).toString();
what=Environment.getExternalStorageDirectory() + "/Playerimages/" + xc + ".jpg";
play_duration=durat.get(1);
//s1.execute(what,play_duration);
new Showtime().execute(what,play_duration);
Log.i("lenght",String.valueOf(i));}
但是当我尝试像这样在无限循环中执行它时,我的应用程序崩溃了:-
for(i=1;i<z-1;i++)
{
xc=cont_id.get(1).toString();
what=Environment.getExternalStorageDirectory() + "/Playerimages/" + xc + ".jpg";
play_duration=durat.get(1);
//s1.execute(what,play_duration);
new Showtime().execute(what,play_duration);
Log.i("lenght",String.valueOf(i));
if(i=Z-1){
i=1;
}}
我的应用程序崩溃了,请有人建议我如何实现它.. 现在我的应用程序没有崩溃,但它没有显示我的 logcat 下面的任何图像
09-04 12:11:31.807: I/dalvikvm-heap(4358): Clamp target GC heap from 48.002MB to 48.000MB
09-04 12:11:31.807: I/dalvikvm-heap(4358): Grow heap (frag case) to 48.000MB for 80-byte allocation
09-04 12:11:32.182: I/dalvikvm-heap(4358): Clamp target GC heap from 50.002MB to 48.000MB
09-04 12:11:32.182: D/dalvikvm(4358): GC_FOR_ALLOC freed 0K, 2% free 48571K/49159K, paused 372ms, total 372ms
09-04 12:11:32.182: I/dalvikvm-heap(4358): Clamp target GC heap from 48.002MB to 48.000MB
09-04 12:11:32.182: I/dalvikvm-heap(4358): Grow heap (frag case) to 48.000MB for 20-byte allocation
09-04 12:11:32.182: D/dalvikvm(4358): WAIT_FOR_CONCURRENT_GC blocked 8390ms
09-04 12:11:32.557: I/dalvikvm-heap(4358): Clamp target GC heap from 50.002MB to 48.000MB
09-04 12:11:32.557: D/dalvikvm(4358): GC_FOR_ALLOC freed 0K, 2% free 48571K/49159K, paused 380ms, total 380ms
09-04 12:11:32.557: I/dalvikvm-heap(4358): Clamp target GC heap from 48.002MB to 48.000MB
09-04 12:11:32.557: I/dalvikvm-heap(4358): Grow heap (frag case) to 48.000MB for 12-byte allocation
09-04 12:11:32.932: I/dalvikvm-heap(4358): Clamp target GC heap from 50.002MB to 48.000MB
09-04 12:11:32.932: D/dalvikvm(4358): GC_CONCURRENT freed 0K, 2% free 48571K/49159K, paused 2ms+3ms, total 371ms
09-04 12:11:32.932: D/dalvikvm(4358): WAIT_FOR_CONCURRENT_GC blocked 369ms
09-04 12:11:33.292: I/dalvikvm-heap(4358): Clamp target GC heap from 50.002MB to 48.000MB
09-04 12:11:33.292: D/dalvikvm(4358): GC_FOR_ALLOC freed 0K, 2% free 48571K/49159K, paused 362ms, total 362ms
09-04 12:11:33.292: I/dalvikvm-heap(4358): Clamp target GC heap from 48.002MB to 48.000MB
09-04 12:11:33.292: I/dalvikvm-heap(4358): Grow heap (frag case) to 48.000MB for 110-byte allocation
09-04 12:11:33.659: I/dalvikvm-heap(4358): Clamp target GC heap from 50.002MB to 48.000MB
09-04 12:11:33.659: D/dalvikvm(4358): GC_FOR_ALLOC freed <1K, 2% free 48571K/49159K, paused 362ms, total 362ms
09-04 12:11:33.659: I/dalvikvm-heap(4358): Clamp target GC heap from 48.002MB to 48.000MB
09-04 12:11:33.659: I/dalvikvm-heap(4358): Grow heap (frag case) to 48.000MB for 24-byte allocation
09-04 12:11:34.026: I/dalvikvm-heap(4358): Clamp target GC heap from 50.002MB to 48.000MB
09-04 12:11:34.026: D/dalvikvm(4358): GC_FOR_ALLOC freed <1K, 2% free 48571K/49159K, paused 368ms, total 368ms
09-04 12:11:34.026: I/dalvikvm-heap(4358): Clamp target GC heap from 48.002MB to 48.000MB
还有更多这样的