Ver Mensaje Individual
  #5  
Viejo 02/06/16, 00:54:01
Array

[xs_avatar]
gonza28 gonza28 no está en línea
Desarrollador
 
Fecha de registro: feb 2012
Localización: INTERESA?
Mensajes: 4,191
Modelo de smartphone: Samsung Galaxy Note 4
Tu operador: Personal
Compañeros. Resuelto!

Esta es la manera. quizás haya otras maneras seguramente las hay. Pero la mia fue así y ojalá sirva a alguien más. Y si alguien necesita mas detalles de como pasar los datos provenientes de una base de datos pregunta y le paso el codigo.

con esto enviamos los datos a la actividad detalles

https://codeshare.io/8td9v

Así recibimos los datos
https://codeshare.io/AXALi

Por las dudas dejo los fragmentos tambien.

[PHP] @override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext())
.inflate(R.layout.item_lista, parent, false);
final ViewHolder vh = new ViewHolder(v);

v.setOnClickListener(new View.OnClickListener() {
@override
public void onClick(View v) {
final int posicion = vh.getAdapterPosition();
if (posicion != RecyclerView.NO_POSITION) {
Log.d(TAG, "onClick() position with: " + posicion);
Log.d(TAG,"ID de la posicion actual:" + items.moveToPosition(posicion));
items.moveToPosition(posicion);

String id = items.getString((Consulta.ID));
String nombre = items.getString((Consulta.NOMBRE));

Intent e = new Intent(contexto, ActividadDetalle.class);
e.putExtra("id", id);
e.putExtra("nombre", nombre);

contexto.startActivity(e);

}
}

});
return vh;
}[/PHP]

[PHP]public class ActividadDetalle extends AppCompatActivity {

private static final String TAG = ActividadDetalle.class.getSimpleName();
private TextView hora, txFecha;

@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);

nombre = (TextView) findViewById(R.id.textNombre);
txId = (TextView) findViewById(R.id.textId);
// Dehabilitar titulo de la actividad
if(getSupportActionBar()!=null)
getSupportActionBar().setDisplayShowTitleEnabled(f alse);



String nombre = getIntent().getStringExtra("nombre");
String id = getIntent().getStringExtra("id");


nombre.setText(nombre);
txId.setText(id);




}

}[/PHP]

Muchas gracias por la mano.
Responder Con Cita