Android Studio failed to compile with Xiaomi

1

I'm making an application with a Navigation Drawer image: link and I wanted to make it through clicking on the top image of the browser (where is the android image) that the Fragment document of the profile was opened (image where the profile would be), to do this I have simply put in the onClick of this object the function:

public void Perfil(View view)
{
        HomeFragment homeFragment = new HomeFragment();
        FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
        fragmentTransaction.replace(R.id.fragment_container, homeFragment);
        fragmentTransaction.commit();
        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        drawer.closeDrawer(GravityCompat.START);
}

When compiling with the Nexus 6 Android 8 of the ADV Emulator it works without problems, but when compiling it with my Xiaomi Mi5s mobile by giving it to where the android image in the Navigation Drawer the application is turned off, in the Debug I put this:

E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: com.example.julianrc1.petracecitm, PID: 19086
                  java.lang.IllegalArgumentException: Expected receiver of type com.example.julianrc1.petracecitm.Usuario, but got android.view.ContextThemeWrapper
                      at java.lang.reflect.Method.invoke(Native Method)
                      at android.view.View$DeclaredOnClickListener.onClick(View.java:4456)
                      at android.view.View.performClick(View.java:5207)
                      at android.view.View$PerformClick.run(View.java:21177)
                      at android.os.Handler.handleCallback(Handler.java:742)
                      at android.os.Handler.dispatchMessage(Handler.java:95)
                      at android.os.Looper.loop(Looper.java:154)
                      at android.app.ActivityThread.main(ActivityThread.java:5544)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
E/MQSEventManagerDelegate: failed to get MQSService.

Thank you very much in advance.

    
asked by BK201 27.01.2018 в 03:21
source

0 answers