package com.bu.api;


import android.app.Activity;
import android.os.Bundle;
import android.widget.*;
import android.view.*;
import android.graphics.drawable.*;

 

public class spi extends Activity implements AdapterView.OnItemSelectedListener {
    /** Called when the activity is first created. */
 TextView selection ;
 ImageButton imgB = null;
 String[] Example = new String[]{"필립모리스","포화속으로"};
 int[] icon = { 
    R.drawable.a
            ,R.drawable.b
            };
 //ImageView drawImage = null;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        imgB = (ImageButton)findViewById(R.id.IB);
        selection = (TextView)findViewById(R.id.selection);
        Spinner s = (Spinner) findViewById(R.id.Spinner);
        s.setOnItemSelectedListener(this);
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
          android.R.layout.simple_spinner_item, Example);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        s.setAdapter(adapter);
        //drawImage   = (ImageView)findViewById(R.id.draw);
        imgB.setOnClickListener(new View.OnClickListener(){
         public void onClick(View v) {
          setContentView(R.layout.sss);
          }  
        });
       
       }
    public void onItemSelected(AdapterView<?> parent, View v, int position , long id){
     //selection.setText(Example[position]);
     Drawable img =getResources().getDrawable(icon[position]);
     imgB.setImageDrawable(img);


     }
 @Override
 public void onNothingSelected(AdapterView<?> parent) {
  // TODO Auto-generated method stub
  selection.setText("");
 }
}


요기까지의 소스 설명을 드리면 해당 리스트의 항목이 클릭되면

하단의그림이 바뀌게 됩니다.

그리고 그 그림을 클릭하면 다음 레이아웃으로 넘어가게 되는데요.
그 넘어가는 레이아웃이
어떤 그림의 버튼을 눌러도 똑같은 레이아웃화면으로 넘어가서요...
그림마다 넘어가는 레이아웃을 틀리게 하고 싶습니다;;