简体   繁体   中英

How to add multiple implementations after AppCompatActivity?

How to add multiple implementations after extending the AppCompatActivity?

Why am I getting this error? Please correct this piece of code.

public class MainActivity extends AppCompatActivity
    implements PopupMenu.OnMenuItemClickListener
    implements NavigationView.OnNavigationItemSelectedListener{

在此处输入图片说明

Change it to

public class MainActivity extends AppCompatActivity
    implements PopupMenu.OnMenuItemClickListener,  NavigationView.OnNavigationItemSelectedListener{

You should read this too.

You shouldn't use implements twice to do so, just use it like this:

public class MainActivity extends AppCompatActivity
     implements firstImplement, secondImplement {}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM