gl 이 gridview이고요 item은 라디오버튼 한개인데 이 라디오버튼이 눌러질때
gettext를 하고싶습니다,,왜안뜰까요 ㅠㅠ
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_margin="7dp"
android:padding="7dp">
<RadioButton
android:id="@+id/p_bug"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/textlines2"
android:textColor="#545454"/>
</LinearLayout>
public void request() {
//사용하기전에 MonthServiceBugs.php 수정필요 (들어가는 데이터를 임의로 설정해줬음 주석을 바꿔야함)
Response.Listener<String> clientListener = new Response.Listener<String>() {
gridAdapter gridAdapter = new gridAdapter();
@Override
public void onResponse(String response) {
try {
JSONObject jsonObject = new JSONObject(response);
JSONArray jsonArray = jsonObject.getJSONArray("result");
for (i = 0; i < jsonArray.length(); i++) {
JSONObject c = jsonArray.getJSONObject(i);
String name = c.getString("name");
ArrayList<String> ntrname = new ArrayList<String>();
if(!(name.equals(""))) {
ntrname.add(name);
gridAdapter.addItem(ntrname);
}
}
gl.setAdapter(gridAdapter);
gl.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id){
RadioButton txt = (RadioButton) view.findViewById(R.id.p_bug);
String s = txt.getText().toString();
Toast.makeText(getContext(), "Your id "+s, Toast.LENGTH_SHORT).show();
Log.d("아",s+"zzz");
}
});
} catch (JSONException e) {
e.printStackTrace();
}
}
};
NssMonthBugRequest nssMonthBugRequest = new NssMonthBugRequest(elog_code, getYear, getMonth, clientListener);
RequestQueue idque = Volley.newRequestQueue(getContext());
idque.add(nssMonthBugRequest);
}