CopyPastor

Detecting plagiarism made easy.

Score: 1; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2013-08-15
by onkar

Original Post

Original - Posted on 2013-08-14
by onkar



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Store the name of all your activities in an array, generate random number and get activity corresponding to random generated number. Sample snippet
String[] title = new String[] { "Act1.class", "Act2.class","Act1.class","Act4.class","Act5.class"}; public String getRandomActivity(){ Random randomGenerator = new Random(); int randomInt = randomGenerator.nextInt(5);// pass number of elements as parameters return title[randomInt-1];//this should return class name } Intent intent = new Intent(this,getRandomActivity()) startActivity(intent)
Store the name of all your activities in an array, generate random number and get activity corresponding to random generated number. Sample snippet
String[] title = new String[] { "Act1.class", "Act2.class","Act1.class","Act4.class","Act5.class"}; public String getRandomActivity(){ Random randomGenerator = new Random(); int randomInt = randomGenerator.nextInt(5);// pass number of elements as parameters return title[randomInt-1];//this should return class name } Intent intent = new Intent(this,getRandomActivity()) startActivity(intent)

        
Present in both answers; Present only in the new answer; Present only in the old answer;