diff --git a/app/src/main/java/worten/aebd/com/worten/Product.java b/app/src/main/java/worten/aebd/com/worten/Product.java index 550a5d6..60c2bf7 100644 --- a/app/src/main/java/worten/aebd/com/worten/Product.java +++ b/app/src/main/java/worten/aebd/com/worten/Product.java @@ -90,6 +90,9 @@ public void onItemClick(AdapterView pariente, View view, int posicion, long i desc = (TextView) findViewById(R.id.desc); desc.setText((CharSequence) producto.getDesc()); + juego = (Button) findViewById(R.id.button3); + + imagen = (ImageView) findViewById(R.id.imageView); if (imagen != null) imagen.setImageResource(producto.get_idImagen()); @@ -125,6 +128,22 @@ public void onClick(View v) { }); + juego.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + CharSequence texto = "Juega para ganar descuentos"; + Toast toast = Toast.makeText(Product.this, texto, Toast.LENGTH_LONG); + toast.show(); + + Intent mainIntent = new Intent(); + mainIntent = new Intent().setClass( + Product.this, Games.class); + startActivity(mainIntent); + + } + }); + + } @Override diff --git a/app/src/main/java/worten/aebd/com/worten/Scaner.java b/app/src/main/java/worten/aebd/com/worten/Scaner.java index 87ac351..a776b9c 100644 --- a/app/src/main/java/worten/aebd/com/worten/Scaner.java +++ b/app/src/main/java/worten/aebd/com/worten/Scaner.java @@ -98,6 +98,9 @@ public void onItemClick(AdapterView pariente, View view, int posicion, long i desc = (TextView) findViewById(R.id.desc); desc.setText((CharSequence) producto.getDesc()); + juego = (Button) findViewById(R.id.button3); + + imagen = (ImageView) findViewById(R.id.imageView); if (imagen != null) imagen.setImageResource(producto.get_idImagen()); @@ -132,6 +135,21 @@ public void onClick(View v) { } }); + juego.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + CharSequence texto = "Juega para ganar descuentos"; + Toast toast = Toast.makeText(Scaner.this, texto, Toast.LENGTH_LONG); + toast.show(); + + Intent mainIntent = new Intent(); + mainIntent = new Intent().setClass( + Scaner.this, Games.class); + startActivity(mainIntent); + + } + }); + }