기술참고자료/Android | 2011. 10. 18. 10:25
아래는 검색했던 블로그의 포스트내용...@Override
public View getView(int position, View convertView, ViewGroup parent) {
final ViewHolder holder;LayoutInflater inf = activity.getLayoutInflater();
View customcell = inf.inflate(R.layout.layout_list_cell, null);VO vo = (VO) cellArray.get(position);TextView total_list_cell_textView01 = (TextView) customcell.findViewById(R.id.comment_name);
TextView total_list_cell_textView02 = (TextView) customcell.findViewById(R.id.comment_date);
TextView total_list_cell_textView03 = (TextView) customcell.findViewById(R.id.comment_content);
total_list_cell_textView01.setText(vo.getContentTitle());
total_list_cell_textView02.setText(vo.getProfileImg());
total_list_cell_textView03.setText(vo.getContentText());
holder = new ViewHolder();
ButtonEvent deleteEvent = new ButtonEvent(this.activity);holder.deleteButton = (ImageButton) customcell.findViewById(R.id.deleteButton);
holder.deleteButton.setOnClickListener(deleteEvent);return customcell;
}
static class ViewHolder {
ImageButton deleteButton;
}
reference : http://developer.android.com/reference/android/widget/ListView.html
[Android] SSL 연결하는 방법 (0) | 2011.11.02 |
---|---|
[Android] ADB 이용해서 패킷 덤프 뜨는 방법 (1) | 2011.11.02 |
[Android] ListView에 내용이 없을때 (0) | 2011.10.18 |
[Android] 미디어 갤러리를 이용한 파일첨부 (0) | 2011.10.18 |
[Android] TableView 모서리 둥글게 처리하기 (0) | 2011.10.18 |
기술참고자료/Android | 2011. 10. 18. 10:22
<LinearLayout android:id="@android:id/empty" android:layout_width="fill_parent" android:layout_height="120dip" android:gravity="center_horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="댓글이 없습니다." /> </LinearLayout> |
[Android] ADB 이용해서 패킷 덤프 뜨는 방법 (1) | 2011.11.02 |
---|---|
[Android] ListView에서의 버튼 이벤트 (0) | 2011.10.18 |
[Android] 미디어 갤러리를 이용한 파일첨부 (0) | 2011.10.18 |
[Android] TableView 모서리 둥글게 처리하기 (0) | 2011.10.18 |
[Android] TextView에서의 줄간격 설정 (0) | 2011.10.18 |
기술참고자료/Android | 2011. 10. 18. 10:18
내용은 길게 못 쓰겠다.
어떠한 클릭이나 터치이벤트 발생시, 아래와같은 메서드를 오버라이딩하여 기본 미디어 갤러리로 인텐트를 넘긴다.
@Override
public boolean onTouch(View v, MotionEvent event)
{
if (event.getAction() == MotionEvent.ACTION_DOWN) {
...
//기본 미디어 갤러리에서 선택 후 사용
Intent intent = new Intent();
intent.setAction( Intent.ACTION_GET_CONTENT );
intent.setType( "image/*" );
activity.startActivityForResult( intent, this.requestCode );
} else if (event.getAction() == MotionEvent.ACTION_UP) {
...
}
return false;
}
그리고 보낸 액티비에서는 콜백메서드를 정의해야 한다.
아래 메서드를 이용하여 정의한다.
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
// requestCode를 이벤트발생시 1로 정의했기때문에 조건문이 포함됨
if (requestCode == 1) {
//미디어 갤러리를 실행한 뒤의 콜백메서드
try {
if(data!=null){
Uri selPhotoUri = data.getData();
Bitmap selPhoto = Images.Media.getBitmap( getContentResolver(), selPhotoUri );
ImageView iView = (ImageView) findViewById(R.id.resultImage);
iView.setImageBitmap(selPhoto);
TextView filePathTxt = (TextView) findViewById(R.id.filePath);
filePathTxt.setText("");
filePathTxt.setText("경로 : " + selPhotoUri.getPath());
...
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
[Android] ListView에서의 버튼 이벤트 (0) | 2011.10.18 |
---|---|
[Android] ListView에 내용이 없을때 (0) | 2011.10.18 |
[Android] TableView 모서리 둥글게 처리하기 (0) | 2011.10.18 |
[Android] TextView에서의 줄간격 설정 (0) | 2011.10.18 |
[Android] Multithreading For Performance (성능 향상을 위한 멀티쓰레딩 기법) (0) | 2011.10.18 |
기술참고자료/Android | 2011. 10. 18. 10:12
1. res폴더->drawable폴더 에 XML 파일 생성(필자의 경우 table_round_corner) 2. 다음의 코드 입력 후 저장 <?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#99FFFFFF"/> <corners android:radius="15dip"/> <padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" /> </shape> android:background="@drawable/table_round_corner" android:padding="10dip" |
[Android] ListView에 내용이 없을때 (0) | 2011.10.18 |
---|---|
[Android] 미디어 갤러리를 이용한 파일첨부 (0) | 2011.10.18 |
[Android] TextView에서의 줄간격 설정 (0) | 2011.10.18 |
[Android] Multithreading For Performance (성능 향상을 위한 멀티쓰레딩 기법) (0) | 2011.10.18 |
[Android] ListView, transcriptMode (0) | 2011.09.20 |
기술참고자료/Android | 2011. 10. 18. 10:08
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/aticle_content" /> </LinearLayout> |
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/aticle_content" android:lineSpacingExtra="15dip" /> </LinearLayout> |
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/aticle_content" android:lineSpacingMultiplier="2.5" /> </LinearLayout> |
[Android] 미디어 갤러리를 이용한 파일첨부 (0) | 2011.10.18 |
---|---|
[Android] TableView 모서리 둥글게 처리하기 (0) | 2011.10.18 |
[Android] Multithreading For Performance (성능 향상을 위한 멀티쓰레딩 기법) (0) | 2011.10.18 |
[Android] ListView, transcriptMode (0) | 2011.09.20 |
[Android] TextView에서 볼드체 쓰기 (0) | 2011.06.21 |