• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How to add random text to splash screen

nagamothu

Newbie
Hi guys can anyone please tell me how to add random text on the splash image in the splash screen.the text on the image should change every time the app opens.How to do that guys,i got till adding text to splash image.but how to add random text which will change every time the app opens.
 
You should be able to set it in the onCreate for the Splash Screen Activity using setText - something like

Code:
protected void onCreate(Bundle savedInstanceState) {
    // other code here
    String randomText = getRandomText(); // You will write this function to generate the random text
    TextView splashScreenText = (TextView)findViewById(R.id.splashScreenText);
    splashScreen.setText(randomText);
}

You can't make it part of the image, you'll need to use a TextView object, and you'll have to play around with the positioning to get it to look right.
 
Back
Top Bottom