테이블비슷하게 짜보고 있는데요
최초 listview 부분에서 글쓰기를 눌러서 글을쓴후 intent로 값을 넘겨서 받았습니다.
근대 그후에 추후 저장하는 부분에서 계속 문제가 해결이 안되서요.. 도움좀 부탁드립니다.
결과 보내는부분 입니다.
save.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
/* String editPostSub,editPostCon;
editPostSub = editPostCon = null;
editPostSub = postSubject.getText().toString();
editPostCon = postContent.getText().toString();*/
Intent intent = new Intent();
intent.putExtra("postSub", postSubject.getText().toString());
intent.putExtra("postCon", postContent.getText().toString());
intent.putExtra("postBy", postBy.getText().toString());
Log.e("postSub", postSubject.getText().toString());
Log.e("postCon", postContent.getText().toString());
Log.e("postBy", postBy.getText().toString());
setResult(RESULT_OK, intent);
finish();
}
});
결과 받는부분이구요
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
switch(resultCode){
case Activity.RESULT_OK:
if(requestCode == 1){
Intent intent = getIntent();
postSubject=intent.getExtras().get("postSub").toString();
postContent=intent.getExtras().get("postCon").toString();
postBy=intent.getExtras().get("postBy").toString();
list.add(new Table_List(postSubject, postContent, postBy));
Table_List_Adapter adapter = new Table_List_Adapter(getApplicationContext(), list);
Log.e(" 결 과 ", adapter.list.get(1).getPostContent());
Log.e(" 결 과 ", adapter.list.get(1).getPostBy());
Log.e(" 결 과 ", adapter.list.get(1).getPostSubject());
listView.setAdapter(adapter);
}//end if
}// end switch
}// end onActivityResult
혹시 도움주실분 네이트온 아이디 안내해서 파일 자체 보내드릴게요 ㅠ 도움좀 부탁드립니다.