I am trying to add a views system to my activity so that whenever a user enters that same activity it updates the value to value + 1. And then I want to show that same number in a TextView.

public class ViewsIntroActivity extends AppCompatActivity {

Button close;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_views_intro);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);


    close = findViewById(R.id.goBack);
    close.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(ViewsIntroActivity.this, MainActivity.class);
            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            overridePendingTransition(0, 0);
            startActivity(intent);
        }
    });
}

}

Related posts

Recent Viewed