Lets say, we have variable var, that store information abaut name of activity. It gets it from shared preferences. I want to make some kind o autosave. Last activity that was initiated send its name do shared preferences. The thing that i dont now, is how to put the name of activity from variable var to intent in switch method in buttonlastactivity. The first buttonnew goes to first activity that is actbegin.
Example:
public void onClick(View view) {
Intent intent;
switch (view.getId()) {
case R.id.buttonnew:
intent = new Intent(actmenu.this, actbegin.class);
startActivity(intent);
break;
case R.id.buttonlastactivity:
intent = new Intent(actmenu.this, ??????.class);
startActivity(intent);
break;
The question is, what to put instead of question marks, to take name of activity that is stored in variable var.
Any suggestions?