Activity 1:
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3)
{
//Pega o item que foi selecionado.
ItemPromo item = adapterListView.getItem(arg2);
//Demostração
//Toast.makeText(this,item.getTexto(), Toast.LENGTH_LONG).show();
Intent intent = new Intent(this,Promocao.class);
intent.putExtra("valor1",item.getTexto());
intent.putExtra("valor2",item.getIconeRid());
startActivity(intent);
}
Activity 2:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_promocao);
lblTeste = (TextView) findViewById(R.id.lblTeste);
imgTeste = (ImageView) findViewById(R.id.imgTeste);
Bundle bundle = getIntent().getExtras();
if(bundle.containsKey("valor1")){
String valor = bundle.getString("valor1");
lblTeste.setText(valor);
}
else if(bundle.containsKey("valor2")){
int v = bundle.getInt("valor2");
imgTeste.setImageAlpha(v);
}
}