Android > DefaultHttpClient - URLÀ» ÀÌ¿ëÇؼ À̹ÌÁö ´Ù¿î·Îµå (¸ÖƼ¾²·¹µå ÀÌ¿ë)
µî·ÏÀÏ : 2017-07-06 17:37
Á¶È¸¼ö : 52,837
¸ÖƼ¾²·¹µå¸¦ ÀÌ¿ëÇؼ ¼¹öÀÇ À̹ÌÁö¸¦ ÆùÀ¸·Î Àоîµå¸®´Â ¹æ¹ýÀÔ´Ï´Ù.
¼Ò½º¸¦ ´Ù¿î¹ÞÀ¸½ÅÈÄ Å×½ºÆ® ¹Ù¶ø´Ï´Ù.
SnowPhotoViewer.java ¼Ò½ºÆÄÀÏÀÔ´Ï´Ù.
package snow.photo.viewer;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.GridView;
public class SnowPhotoViewer extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button btnDownload = (Button)findViewById(R.id.btnButton);
btnDownload.setOnClickListener(myButtonClick);
}
Button.OnClickListener myButtonClick = new Button.OnClickListener()
{
public void onClick(View v)
{
String [] strURLS = {"http://cfile25.uf.tistory.com/image/112CA2274C2220D2B47CB1",
"http://cfile24.uf.tistory.com/image/110475474D666C30382331",
"http://cfile24.uf.tistory.com/image/110475474D666C30382331",
"http://cfile24.uf.tistory.com/image/110475474D666C30382331",
};
GridView gv = (GridView)findViewById(R.id.gvGridView);
ImageAdapter imgAdapter = new ImageAdapter(strURLS);
gv.setAdapter(imgAdapter);
}
};
}
Àüü ÇÁ·ÎÁ§Æ® ÆÄÀÏ Ã·ºÎÇÕ´Ï´Ù.
SnowPhotoViewer.zip