Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

image show by timer android studio

public class MainActivity extends Activity {

Random random = new Random();
int max = 2;
int min = 0;

ImageView imageView;

Integer[] image = { R.drawable.ic_launcher, R.drawable.tmp,R.drawable.android };

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.splash);

    int randomNumber = random.nextInt(max - min + 1) + min;

    imageView = (ImageView) findViewById(R.id.img);

    imageView.setImageResource(image[randomNumber]);

    new Handler().postDelayed(new Runnable() {

        @Override
        public void run() {
            Intent intent = new Intent(MainActivity.this, Act.class);
            startActivity(intent);
        }
    }, 5000);
  }
}
Comment

PREVIOUS NEXT
Code Example
Java :: java scanner class time 
Java :: java map get if contains else 0 
Java :: sha1 
Java :: unique numbers in array java 
Java :: class c { public static void main(string[] args){ system.out.println("hello"+args[0]);}} output 
Java :: java main setup 
Java :: create object of hashMap with integer key and String value 
Java :: Android java parse class name via intent 
Java :: java mongodb document get 
Java :: one to many relation between objects 
Java :: android string animation 
Java :: how to preset an array java 
Java :: ternario java 
Java :: Java @SuppressWarnings Annotation Example 
Java :: how to enforce xml dtd validation in java 
Java :: for-each Loop Sytnax JAVA 
Java :: setbackgroundcolor android 
Java :: android studio epoch to localdatetime 
Java :: closable resources java 
Java :: log errors with stack traces spring 
Java :: action media scanner scan file android 30 deprecated 
Java :: arrays in constructor java 
Java :: javafx choicebox get index 
Java :: download a website as string kotlin 
Java :: substring in java 
Java :: java coding standards for constants 
Java :: how to clear the consol after input java 
Java :: get string match percentage java 
Java :: how to reinstall nginuity 
Java :: java yaml unchecked cast 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =