if
(list_itemArrayList ==
null
);
list_itemArrayList =
new
ArrayList<list_item>();
try
{
if
(getIntent().hasExtra(
"json"
)) {
JSONObject json =
new
JSONObject(getIntent().getStringExtra(
"json"
));
title = json.getString(
"postTitle"
);
name = json.getString(
"postName"
);
Log.i(
"asd"
,
"잘된다1"
);
if
(list_itemArrayList ==
null
);
}
Log.i(
"asd"
,
"잘된다2:"
);
if
(list_itemArrayList ==
null
);
Log.i(
"asd"
,
"잘된다3:"
);
list_itemArrayList.add(
new
list_item(
"제목: "
+title,
"작성자: "
+name,
""
));
}
catch
(JSONException e) {
e.printStackTrace();
}
ListAdapter =
new
listAdapter(MainActivity.
this
,list_itemArrayList);
list1.setAdapter(ListAdapter);
list1.setOnItemClickListener(
new
AdapterView.OnItemClickListener() {
@Override
public
void
onItemClick(AdapterView<?> adapterView, View v,
int
position,
long
id) {
try
{
if
(getIntent().hasExtra(
"json"
)) {
JSONObject json =
new
JSONObject(getIntent().getStringExtra(
"json"
));
title = json.getString(
"postTitle"
);
name = json.getString(
"postName"
);
Intent intent =
new
Intent(getApplicationContext(), readboard.
class
);
intent.putExtra(
"json"
, json.toString());
startActivity(intent);
}
}
catch
(JSONException e) {
e.printStackTrace();
}
}
});