'Disable Reset button for every user and enable for only admin in android studio

so i have reset button which resets int values. i want only admin can click thT reset BUTTON and for every other user that button should be unclickable or hidden will. '''

   ``` RESET = findViewById ( R.id.RESET );  ```
    btncount10 = findViewById ( R.id.btncount10 );
    tvcount10 =findViewById ( R.id.tvcount10 );


    count10counter= marketcount10.loadtotalfromprefmarketcount10 ( this );
    tvcount10.setText ( Integer.toString ( count10counter ) );

    btncount10.setOnClickListener ( new View.OnClickListener ( ) {

        @Override
        public void onClick(View v) {
            count10counter++;


            marketcount10.saveTotalInPrefcount10 ( getApplicationContext (),count10counter );
            tvcount10.setText ( Integer.toString ( count10counter ) );

            Toast.makeText ( getApplicationContext (),"you clicked market jodi 10",Toast.LENGTH_SHORT ).show ();
        }

    } );








    btncount11 = findViewById ( R.id.btncount11 );
    tvcount11 =findViewById ( R.id.tvcount11 );

    count11counter= marketcount11.loadtotalfromprefmarketcount11 ( this );
    tvcount11.setText ( Integer.toString ( count11counter ) );

    btncount11.setOnClickListener ( new View.OnClickListener ( ) {
        @Override
        public void onClick(View v) {
            count11counter++;
            marketcount11.saveTotalInPrefcount11 ( getApplicationContext (),count11counter );
            tvcount11.setText ( Integer.toString ( count11counter ) );
            Toast.makeText ( getApplicationContext (),"you clicked market jodi 11",Toast.LENGTH_SHORT ).show ();
        }
    } );

    btncount12 = findViewById ( R.id.btncount12 );
    tvcount12 =findViewById ( R.id.tvcount12 );

    count12counter= marketcount12.loadtotalfromprefmarketcount12 ( this );
    tvcount12.setText ( Integer.toString ( count12counter ) );

    btncount12.setOnClickListener ( new View.OnClickListener ( ) {
        @Override
        public void onClick(View v) {
            count12counter++;
            marketcount12.saveTotalInPrefcount12 ( getApplicationContext (),count12counter );
            tvcount12.setText ( Integer.toString ( count12counter ) );
            Toast.makeText ( getApplicationContext (),"you clicked market jodi 12",Toast.LENGTH_SHORT ).show ();
        }
    } );

    btncount13 = findViewById ( R.id.btncount13 );
    tvcount13 =findViewById ( R.id.tvcount13 );

    count13counter= marketcount13.loadtotalfromprefmarketcount13 ( this );
    tvcount13.setText ( Integer.toString ( count13counter ) );

    btncount13.setOnClickListener ( new View.OnClickListener ( ) {
        @Override
        public void onClick(View v) {
            count13counter++;
            marketcount13.saveTotalInPrefcount13 ( getApplicationContext (),count13counter );
            tvcount13.setText ( Integer.toString ( count13counter ) );
            Toast.makeText ( getApplicationContext (),"you clicked market jodi 13",Toast.LENGTH_SHORT ).show ();
        }
    } );
    btncount14 = findViewById ( R.id.btncount14 );
    tvcount14 =findViewById ( R.id.tvcount14 );

    count14counter= marketcount14.loadtotalfromprefmarketcount14 ( this );
    tvcount14.setText ( Integer.toString ( count14counter ) );

    btncount14.setOnClickListener ( new View.OnClickListener ( ) {
        @Override
        public void onClick(View v) {
            count14counter++;
            marketcount14.saveTotalInPrefcount14 ( getApplicationContext (),count14counter );
            tvcount14.setText ( Integer.toString ( count14counter ) );
            Toast.makeText ( getApplicationContext (),"you clicked market jodi 14",Toast.LENGTH_SHORT ).show ();
        }
    } );
    btncount15 = findViewById ( R.id.btncount15 );
    tvcount15 =findViewById ( R.id.tvcount15 );

    count15counter= marketcount15.loadtotalfromprefmarketcount15 ( this );
    tvcount15.setText ( Integer.toString ( count15counter ) );

    btncount15.setOnClickListener ( new View.OnClickListener ( ) {
        @Override
        public void onClick(View v) {
            count15counter++;
            marketcount15.saveTotalInPrefcount15 ( getApplicationContext (),count15counter );
            tvcount15.setText ( Integer.toString ( count15counter ) );
            Toast.makeText ( getApplicationContext (),"you clicked market jodi 15",Toast.LENGTH_SHORT ).show ();
        }
    } );
    btncount16 = findViewById ( R.id.btncount16 );
    tvcount16 =findViewById ( R.id.tvcount16 );

    count16counter= marketcount16.loadtotalfromprefmarketcount16 ( this );
    tvcount16.setText ( Integer.toString ( count16counter ) );

    btncount16.setOnClickListener ( new View.OnClickListener ( ) {
        @Override
        public void onClick(View v) {
            count16counter++;
            marketcount16.saveTotalInPrefcount16 ( getApplicationContext (),count16counter );
            tvcount16.setText ( Integer.toString ( count16counter ) );
            Toast.makeText ( getApplicationContext (),"you clicked market jodi 16",Toast.LENGTH_SHORT ).show ();
        }
    } );
    btncount17 = findViewById ( R.id.btncount17 );
    tvcount17 =findViewById ( R.id.tvcount17 );

    count17counter= marketcount17.loadtotalfromprefmarketcount17 ( this );
    tvcount17.setText ( Integer.toString ( count17counter ) );

    btncount17.setOnClickListener ( new View.OnClickListener ( ) {
        @Override
        public void onClick(View v) {
            count17counter++;
            marketcount17.saveTotalInPrefcount17 ( getApplicationContext (),count17counter );
            tvcount17.setText ( Integer.toString ( count17counter ) );
            Toast.makeText ( getApplicationContext (),"you clicked market jodi 17",Toast.LENGTH_SHORT ).show ();
        }
    } );
    btncount18 = findViewById ( R.id.btncount18 );
    tvcount18 =findViewById ( R.id.tvcount18 );

    count18counter= marketcount18.loadtotalfromprefmarketcount18 ( this );
    tvcount18.setText ( Integer.toString ( count18counter ) );

    btncount18.setOnClickListener ( new View.OnClickListener ( ) {
        @Override
        public void onClick(View v) {
            count18counter++;
            marketcount18.saveTotalInPrefcount18 ( getApplicationContext (),count18counter );
            tvcount18.setText ( Integer.toString ( count18counter ) );
            Toast.makeText ( getApplicationContext (),"you clicked market jodi 18",Toast.LENGTH_SHORT ).show ();
        }
    } );
    btncount19 = findViewById ( R.id.btncount19 );
    tvcount19 =findViewById ( R.id.tvcount19 );

    count19counter= marketcount19.loadtotalfromprefmarketcount19 ( this );
    tvcount19.setText ( Integer.toString ( count19counter ) );

    btncount19.setOnClickListener ( new View.OnClickListener ( ) {
        @Override
        public void onClick(View v) {
            count19counter++;
            marketcount19.saveTotalInPrefcount19 ( getApplicationContext (),count19counter );
            tvcount19.setText ( Integer.toString ( count19counter ) );
            Toast.makeText ( getApplicationContext (),"you clicked market jodi 19",Toast.LENGTH_SHORT ).show ();
        }




    } );







}


public void RESET (View view){
    count10counter  = 0;
    count11counter  = 0;
    count12counter  = 0;
    count13counter  = 0;
    count14counter  = 0;
    count15counter  = 0;
    count16counter  = 0;
    count17counter  = 0;
    count18counter  = 0;
    count19counter  = 0;}

'''

my second question is i want btncount10 to btncount19 all this button should be disable from 15.00pm to 17.00 pm daily and should be enable for every other time.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source