Android sharedpence question.

Asked 2 years ago, Updated 2 years ago, 24 views

    TextView NavId = findViewById(R.id.nav_id);
    SharedPreferences sp = getSharedPreferences("sp", MODE_PRIVATE);
    String User_Id2 = sp.getString("User_Id", "");
    NavId.setText(User_Id2);
    Log.d("123123", NavId + "123123");

I don't know why the setText is null. It's properly stored in sharedpreference It's a simple setting for textview. What's the problem?

It'sincerely NavId.setText("!23123"); Even if I take it like this, the null value comes in

android

2022-09-22 20:15

1 Answers

Yes, that's right ㅠ<


2022-09-22 20:15

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.