I was still confused in the StaticClass code, which gave my friend an alternative, except for Shared Preferences, for 3 days I tried to find out the code and asked, but there is still a small problem with the code
this is the last following code in my selectlevel.class that I improved
public class selectlevel extends Activity { Button f1, f2, f3; ImageView f2lock, f3lock; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.selectlevel); f1=(Button)findViewById(R.id.f1); f1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v){
and I used this in my levelone.class to send update progress to 1
button1.setOnClickListener(new View.OnClickListener() { public void onClick(View v){ selectlevel.PlayerProgress.updateProgress(1); finish();
but when levelone.class finished, the f2 button is still GONE and f2lock is still VISIBLE

nothing changes in selectlevel.class
Interestingly, it can be seen like this one and still visible if the game opens again because the visibility of the button is saved.

Can someone help me fix a problem in my code? or give an explanation with another code as a solution?
source share