In my program, I'm creating shapes which are filled with random colors from a list. The colors are set in onCreate. I don't want it to have determined colors, but to change the colors multiple times. How do I 'restart' the onCreate part, so the colors are allocated again?
public class MainActivity extends Activity implements OnGestureListener
{
private Paint paint = new Paint();
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Canvas canvas = new Canvas(bg);
List<Integer> numbers = Arrays.asList(Color.RED, Color.BLUE, Color.GREEN, Color.YELLOW);
Collections.shuffle(numbers);
}
}