Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void loadUserInformation() {
- final String mNumber = getActivity().getIntent().getStringExtra("Phone_Number");
- DatabaseReference rootRef = FirebaseDatabase.getInstance().getReference();
- DatabaseReference usesrRef = rootRef.child("Users").child(uid);
- ValueEventListener eventListener = new ValueEventListener() {
- @Override
- public void onDataChange(DataSnapshot dataSnapshot) {
- EditText Name = (EditText) rootView.findViewById(R.id.Name);
- ImageView profilePic = (ImageView)rootView.findViewById(R.id.profilePic);
- for(DataSnapshot postSnapshot: dataSnapshot.getChildren()){
- String name=postSnapshot.child("Name").getValue().toString();
- String email=postSnapshot.child("Email").getValue().toString();
- String status=postSnapshot.child("Status").getValue().toString();
- String quote=postSnapshot.child("Quote").getValue().toString();
- String number = postSnapshot.child("Phone_Number").getValue().toString();
- String image = dataSnapshot.child("Image").getValue().toString();
- Name.setText(name);
- Email.setText(email);
- Status.setText(status);
- Quote.setText(quote);
- Number.setText(number);
- Picasso.get().load(image).into(profilePic);
- }
- @Override
- public void onCancelled(DatabaseError databaseError) {
- Toast.makeText(getActivity(),"Error Loading UserDetails",Toast.LENGTH_LONG).show();
- }
- };
- usesrRef.addListenerForSingleValueEvent(eventListener);
- }
- @Test
- public void givenNull_whenCreatesNullable_thenCorrect() {
- String name = null;
- Optional<String> opt = Optional.ofNullable(name);
- assertEquals("Optional.empty", opt.toString());
- }
- String status=postSnapshot.hasChild("Status") ? postSnapshot.child("Status").getValue().toString() : 'NULL';
- String quote=postSnapshot.hasChild("Quote") ? postSnapshot.child("Quote").getValue().toString() : 'NULL';
Add Comment
Please, Sign In to add comment