»Ë»Ñ Æ÷·³
°³¹ßÀÚÆ÷·³ ÀÔ´Ï´Ù.
  • ºÏ¸¶Å© ¾ÆÀÌÄÜ

[¾Èµå·ÎÀ̵å] Thread ¾ÈÁ¤¼º °ü·Ã ¹®Àǵ帳´Ï´Ù.5

¾È³çÇϼ¼¿ä.

 

´ÙÀ½°ú °°Àº Äڵ忡¼­ thread¸¦ ½ÇÇà½Ãŵ´Ï´Ù. cityArrayÀÇ ±æÀÌ´Â 17ÀÔ´Ï´Ù.

	for(int i=0; i<cityArray.length; i++)
{
final int finalI = i;
new Thread(new Runnable() {
@Override
public void run() {
setMarkerIcon(cityArray[finalI]);
}
}).start();
}

setMarkerIcon¸Å¼­µå´Â ´ÙÀ½°ú °°½À´Ï´Ù.

	public void setMarkerIcon( final String city ){
final MarkerItem markerItem = getBestMarkerItemfromArrayList(city);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
Log.i(TAG, "run: ");
if(markerItem != null){
Glide.with(getContext())
.load(R.drawable.back_level3)
.asBitmap()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap bitmap, GlideAnimation<? super Bitmap> glideAnimation) {
Log.i(TAG, "onResourceReady: " + map.getMarkers().size() + "__" + city);
for (int i = 0; i < markerOptions.length; i++) {
if (map.getMarkers().get(i).getData().equals(city)) { //¹è¿­ ¼ø¼­°¡ ´Þ¶óÁö¹Ç·Î °É·¯ÁÖ±â
map.getMarkers().get(i).setIcon(BitmapDescriptorFactory.fromBitmap(createDrawableFromView(city, bitmap)));
break;
}
}
}
});

 

setMarkerIcon¸Å¼­µå ¾È¿¡¼­ getBestMakerItemfromArrayList(city)¸¦ È£ÃâÇϹǷÎ

ÇØ´ç ¸Å¼­µå¸¦ ½º·¹µå·Î ¹°¸° µÚ¿¡

 

view¿¡ Ç¥½ÃÇϱâ À§ÇØ getActivity.runOnUiThread()¸¦ »ç¿ëÇÏ¿´´Âµ¥¿ä,

 

Å×½ºÆ® »ó¿¡¼­ ¹®Á¦´Â ¹ß°ßµÇÁö ¾Ê¾Ò½À´Ï´Ù¸¸

 

ÀÌ¿Í °°Àº ±¸Á¶¿¡ ¹®Á¦°¡ »ý±æ ¼ö ÀÖÀ»±î¿ä?

°í°ß ºÎŹµå¸³´Ï´Ù. °¨»çÇÕ´Ï´Ù.

 

 

0
ÃßõÇϱ⠴ٸ¥ÀÇ°ß 0
|
°øÀ¯¹öÆ°

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 hansolo

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 Çϴú¸´ÏÇÏ´Ï

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ÈÖ¿ÍǪ·è

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 luopleming

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ¿ìÇÏÇÏÈ£
  • ¾Ë¸² ¿å¼³, »óó ÁÙ ¼ö ÀÖ´Â ¾ÇÇÃÀº »ï°¡ÁÖ¼¼¿ä.
©¹æ »çÁø  
¡â ÀÌÀü±Û¡ä ´ÙÀ½±Û ¸ñ·Ïº¸±â