chome and Edge configure the IE mode through the group strategy and always allow Flash (official solution)

2023-01-05   ES  

1. Use internal anonymous class:

Private Button Button; 
 @Override 
 Protected void onCreate (Bundle Savedinstancestate) { 
 Super.Oncreate (Savedinstancestate); 
 setContentView (r.Layout.activity_main); 
 Button = (Button) FindViewByid (R.id.button); 
 Button.SetonClickListener (New Onclicklistener () { 
 @Override 
 public void onClick (view v) { 
 // Add logic here 
 } 
 }); 
 }

2. Realize the interface to register the monitor

PUBLIC Class MainAICTIVITITY Extends Activity Implements View.onClickListener { 
   Private Button Button; 
     @Override 
     Protected void onCreate (Bundle Savedinstancestate) { 
         Super.Oncreate (Savedinstancestate); 
         RequestWindow Feature (Window. Feature_no_title); 
         setContentView (r.Layout.activity_main); 
         Button = (Button) FindViewByid (R.id.button); 
         Button.SetonClickListener (this); 
     } 

     @Override 
     public void onClick (view v) { 
     switch (v.getid ()) {{ 
         case r.id.button: { 
             Toast.makeText (mainactivity.this, "Monitoring by implementing interface", toast.length_short) .show ();););); 
         } Break; 
         default: break; 
     } 
     } 
 }

source

Related Posts

dubbo -four load -load balancing algorithms

Recommend a super easy -to -use tool CMDERQXQZX

MyBatis-Plus Open and close SQL log printing

Apache Commons-Codec package

chome and Edge configure the IE mode through the group strategy and always allow Flash (official solution)

Random Posts

linux yum download installation package (only download package is not installed)

LINUX system switch root permissions and ordinary user permissions lin

MongoDB installation configuration and PyMongo installation and use

POJ3006, Dirichlet’s theorem on Arithmetic Progressions, Di Likrey theorem.

cv2.imresize error