Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.nofar.session24q3; //When i click on a button rnd and logcat will see rnd number
- import android.app.Activity;
- import android.os.Bundle;
- import android.util.Log;
- import android.view.View;
- import java.util.Random;
- public class MainActivity extends Activity {
- Random rnd = new Random();
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- int y = 66; //new option ,exmple.
- y++;
- int x = 9 + rnd.nextInt(6);
- Log.i("calc1", x + "");
- }
- public void method1(View view) {//log cat rnd1
- int x = 100+ rnd.nextInt(1000-100+1);//100-1000
- Log.i("calc1", x + "");
- }
- public void method2(View view) {//log cat rnd2
- int x =100+ rnd.nextInt(1000-100+1) ;//100-1000
- Log.i("calc1", x + "");
- }
- public void method3(View view) {//log cat rnd3
- int x = 100+ rnd.nextInt(1000-100+1);//100-1000
- Log.i("calc1", x + "");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement