Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created March 12, 2019 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/c0cd11d32253491895ba71b86bd86002 to your computer and use it in GitHub Desktop.
Save parzibyte/c0cd11d32253491895ba71b86bd86002 to your computer and use it in GitHub Desktop.
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
Bundle datosRecuperados = getArguments();
if (datosRecuperados == null) {
// No hay datos, manejar excepción
return;
}
// Y ahora puedes recuperar usando get en lugar de put
long id = datosRecuperados.getLong("id");
int edad = datosRecuperados.getInt("edad");
String nombre = datosRecuperados.getString("nombre");
// Imprimimos, pero en tu caso haz lo necesario
Log.d("GastosFragmentEditar", "El ID: " + id);
Log.d("GastosFragmentEditar", "La edad: " + edad);
Log.d("GastosFragmentEditar", "El nombre: " + nombre);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment