for
(
int
i=
0
; i < miniMapInfo.length; i++){
beCaptured =
true
;
publishProgress(
null
, (
int
) (((
float
) (i +
5
) / stepMax) * progressBar.getMax()), i,
0
);
while
(
true
){
if
(!beCaptured){
miniMapView.setDrawingCacheEnabled(
true
);
miniMapBitmap = miniMapView.getDrawingCache();
stream =
new
ByteArrayOutputStream();
miniMapBitmap.compress(Bitmap.CompressFormat.PNG,
100
, stream);
miniMapView.setDrawingCacheEnabled(
false
);
beCaptured =
true
;
publishProgress(
null
,
null
, i,
1
);
while
(
true
) {
if
(!beCaptured){
break
;
}
else
{
try
{
Thread.sleep(
50
);
}
catch
(InterruptedException e) {
e.printStackTrace();
}
}
if
( ((
double
)( System.currentTimeMillis() - captureStartTime)) >=
3000
){
break
;
}
}
break
;
}
else
{
try
{
Thread.sleep(
50
);
}
catch
(InterruptedException e) {
e.printStackTrace();
}
}
if
( ((
double
)( System.currentTimeMillis() - captureStartTime)) >=
20000
){
break
;
}
}
}
beCaptured =
false
;
publishProgress(R.string.load_msg_complete, progressBar.getMax());
try
{
Thread.sleep(
100
);
}
catch
(InterruptedException e) {
e.printStackTrace();
}
return
progressBar.getMax();
}