I want to randomize my layout using this code:
public class testing extends Activity
{
/** Called when the activity is first created. */
private Integer [] mLinearLayoutIds = {
R.layout.games0,
R.layout.games1,
R.layout.games2,
R.layout.games3,
R.layout.games4,
R.layout.games5,
};
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Random random = new java.util.Random();
int rand = random.nextInt(6);
setContentView(mLinearLayoutIds[rand]);
}
}
but, every time the layout that was shown before is shown again.
How do I mark for a layout that has been shown before so it does not show again?