Изменить стиль текста данных из базы данных Firebase - PullRequest
0 голосов
/ 07 ноября 2019

Я хочу изменить стиль текста данных, полученных из базы данных firebase. В настоящее время он выглядит так: [r] [1]

! [https://i.stack.imgur.com/p3Sfl.png] [1]

public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    final View v = inflater.inflate(R.layout.activity_user_profile, container, false);

    btEdit = v.findViewById(R.id.button_edit);
    btRefresh = v.findViewById(R.id.button_refresh);
    mChildValueTextView = v.findViewById(R.id.childValueTextView);
    String uid = FirebaseAuth.getInstance().getCurrentUser().getUid();
    DatabaseReference rootRef = FirebaseDatabase.getInstance().getReference();
    DatabaseReference uidRef = rootRef.child("Users").child(uid);
    ValueEventListener valueEventListener = new ValueEventListener() {
        @Override
        public void onDataChange(DataSnapshot dataSnapshot) {
            String age = dataSnapshot.child("age").getValue(String.class);
            String name = dataSnapshot.child("name").getValue(String.class);
            String sex = dataSnapshot.child("sex").getValue(String.class);
            Log.d("TAG", name + ", " + sex + ", " + age);
            String childValue = String.valueOf(dataSnapshot.getValue());
            mChildValueTextView.setText(childValue);

        }

        @Override
        public void onCancelled(@NonNull DatabaseError databaseError) {
            Log.d("TAG", databaseError.getMessage()); //Don't ignore errors!
        }
    };
    uidRef.addListenerForSingleValueEvent(valueEventListener);

'' '

XML-код

  <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/childValueTextView"/>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...