Category 클래스

i.putExtra("data_id", cursor.getColumnIndex("bname"));

로 넘겨서


buildingcategory 클래스

String temp = getIntent().getStringExtra("data_id");

로 받으려고 하는데...


Toast로 잘 넘어왔는지 확인해보면, 아무 값도 못받아 오네요...;; 왜그럴까요??


데이터베이스를 

Category 클래스 에서

ListActivity를 사용하여

textviewbname만 쭉 ~ 리스트로 출력한 다음에 

클릭한 bname 값을 어떻게하면 제대로 넘겨줄 수 있을까요?


이렇게 넘어온 값을

buildingcategory 클래스에서

ListActivity를 사용하여

textview로 bname에 해당하는 값을 모두 출력해주려고 합니다. bname, baddress, bcall 등등...



Category 클래스 /extends ListActivity

  public void onListItemClick(ListView list, View view, int position, long id) {
		Intent i = new Intent(Category.this, buildingcategory.class);
		//클릭한 내용 저장(bname)
		i.putExtra("data_id", cursor.getColumnIndex("bname"));
		startActivity(i);
}


buildingcategory 클래스 /extends ListActivity

private void init() {
		// 클릭한 내용 받아옴(bname)
		String temp = getIntent().getStringExtra("data_id");
		Toast.makeText(this, temp, Toast.LENGTH_LONG).show();

		cursor = managedQuery(Building.buildings.CONTENT_URI, null, "bname="+temp, null, null);
		String[] from = new String[]{Building.buildings.BNAME, Building.buildings.BADDRESS,Building.buildings.BLOCATE};
		int[] to = new int[]{R.id.row_bname, R.id.row_baddress, R.id.row_blocate};

		adapter = new SimpleCursorAdapter(this, R.layout.building_row, cursor, from, to);
		setListAdapter(adapter);
	}