android-developers
[Arriba] [Todas las Listas]

[android-developers] java.lang.IllegalArgumentException Cuando cambiando

To: Android Developers <android-developers@xxxxxxxxxxxxxxxx>
Subject: [android-developers] java.lang.IllegalArgumentException Cuando cambiando fragmentos
From: Dimple <dimple788@xxxxxxxxx>
Date: Mon, 14 Aug 2017 02:07:35 -0700 (PDT)
Delivery-date: Mon, 14 Aug 2017 05:08:58 -0400
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=Xp3O+ycHIZyb5hGflVeRXJPxLaGeIBLxqyvUegvGWts=; b=sLJ/UA5tIcgPB3yuwHRpfv1JnLc6pHPov+YVGwc26w5lW8P0QYd1xiJxwCCOaOUVpI vBhzRPQc2Yo1KaGzEhPsPlM5hD07KrHBFb6bQd+VpZYq5GTPI8vKIQDqwbTUniYsL/Lb LKQS402neNx70dQoxJ5wT8jbyabFxXSh2P+HrvyY2X8ZfLezmtY7o/HZ+C/zVmBVNOHQ +8RJoQ2BFh1Lob+ebKJIe4coXT43NsYRRIUwcB6gw/lDL6I0qlCjuaL3p5TvBN/+KJTT 7UisQqighfox8nX7GA+9UHsVTBGzx4CVccKXgcyg2ujbvKnZEnUSpiNuYLLTltkKg+/d mUTw==
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:subject:mime-version:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=Xp3O+ycHIZyb5hGflVeRXJPxLaGeIBLxqyvUegvGWts=; b=QvEgkNp3CjPOWOKQo0v2/ycxXiq1VeEg8IwebMmLzRcEo5lHXXy9G3T24zo5AZ+lFp Jx8PO6O6jxe6RxzIr9xxg0LwrkZKZRSh/np1s396zKLvoWLvGScXzScX55ioX7UQlgy6 EsOYZvpjUqNQCAVyue5vUADQvoF2NQmfc/KCDDjyWijFni0o9oGDCntthHyFUOW+lyi6 X/fcYchy7XnQM3HDrwjEWc7FAMR7SlzhbNFhh3yZJkR+vx6Cp+lbbKoMU93yaSfsEGwP 7L7VUn9YLoh5/Q12uLAg4xttJuHMoD3rG/PnjdAnhCurk06n/b0nq93kMMcH8u+drK+w dsHw==
Envelope-to: traductor@xxxxxxxxxxx
List-archive: <https://groups.google.com/group/android-developer>
List-help: <https://groups.google.com/support/>, <mailto:android-developers+help@googlegroups.com>
List-id: <android-developers.googlegroups.com>
List-post: <https://groups.google.com/group/android-developers/post>, <mailto:android-developers@googlegroups.com>
List-subscribe: <https://groups.google.com/group/android-developers/subscribe>, <mailto:android-developers+subscribe@googlegroups.com>
List-unsubscribe: <mailto:googlegroups-manage+364598216046+unsubscribe@googlegroups.com>, <https://groups.google.com/group/android-developers/subscribe>
Mailing-list: list android-developers@xxxxxxxxxxxxxxxx; contact android-developers+owners@xxxxxxxxxxxxxxxx
Reply-to: android-developers@xxxxxxxxxxxxxxxx
Sender: android-developers@xxxxxxxxxxxxxxxx
 

Tengo un *app que tiene una barra inferior con tres fragmentos. hay también unos cuantos 
fragmentos de niño que están siendo llamado de fragmentos de padre. *Google 
Consola de juego muestra varios accidentes debido a *java.*lang.*IllegalArgumentException. 
No puedo parecer a *replicate el error, y nada señala a mi código en 
el *logs. 

Puede cualquiera *decipher lo que podría ser el problema? 

Aquí es el error *stack rastro.

*java.*lang.*RuntimeException: 
En *android.*app.*ActivityThread.*performLaunchActivity (*ActivityThread.*java:3190)
en *android.*app.*ActivityThread.*handleLaunchActivity (*ActivityThread.*java:3300)
en *android.*app.*ActivityThread.Acceso$1000 (*ActivityThread.*java:211)
en *android.*app.*ActivityThread$*H.*handleMessage (*ActivityThread.*java:1705)
en *android.*os.*Handler.*dispatchMessage (*Handler.*java:102)
en *android.*os.*Looper.Bucle (*Looper.*java:145)
en *android.*app.*ActivityThread.Principal (*ActivityThread.*java:6946)
en *java.*lang.Refleja.Método.Invoca (Método Nativo)
en *java.*lang.Refleja.Método.Invoca (Método.*java:372)
en *com.*android.Interno.*os.*ZygoteInit$*MethodAndArgsCaller.Carrera (*ZygoteInit.*java:1404)
en *com.*android.Interno.*os.*ZygoteInit.Principal (*ZygoteInit.*java:1199)
Causado por: *java.*lang.*IllegalArgumentException: 
En *android.Apoyo.*v4.*app.*FragmentManagerImpl.*moveToState (*FragmentManager.*java:1293)
en *android.Apoyo.*v4.*app.*FragmentManagerImpl.*moveFragmentToExpectedState (*FragmentManager.*java:1528)
en *android.Apoyo.*v4.*app.*FragmentManagerImpl.*moveToState (*FragmentManager.*java:1595)
en *android.Apoyo.*v4.*app.*BackStackRecord.*executeOps (*BackStackRecord.*java:758)
en *android.Apoyo.*v4.*app.*FragmentManagerImpl.*executeOps (*FragmentManager.*java:2363)
en *android.Apoyo.*v4.*app.*FragmentManagerImpl.*executeOpsTogether (*FragmentManager.*java:2149)
en *android.Apoyo.*v4.*app.*FragmentManagerImpl.*optimizeAndExecuteOps (*FragmentManager.*java:2103)
en *android.Apoyo.*v4.*app.*FragmentManagerImpl.*execPendingActions (*FragmentManager.*java:2013)
en *android.Apoyo.*v4.*app.*FragmentController.*execPendingActions (*FragmentController.*java:388)
en *android.Apoyo.*v4.*app.*FragmentActivity.*onStart (*FragmentActivity.*java:607)
en *android.Apoyo.*v7.*app.*AppCompatActivity.*onStart (*AppCompatActivity.*java:178)
en *android.*app.Instrumentación.*callActivityOnStart (Instrumentación.*java:1264)
en *android.*app.Actividad.*performStart (Actividad.*java:6613)
en *android.*app.*ActivityThread.*performLaunchActivity (*ActivityThread.*java:3153)

Mostrado abajo es el *launcher público de código

de la actividad *void *onMenuItemSelected(*int *itemId)#nom_de_nom de Fragmento;cambio (*itemId)
    #nom *R.*id.Casa:
    el fragmento = nuevo *HomeFragment();
    si (fragmento != *null)
        #unknown{^*getSupportFragmentManager().*beginTransaction()
        .Reemplaza(*R.*id.Marco_de contenido, fragmento).Comete();
    }más {
    }
    rotura;
    caso *R.*id.Perfil:

    el fragmento = nuevo *ProfileFragment();
    si (fragmento != *null)
        #unknown{^*getSupportFragmentManager().*beginTransaction()
        .Reemplaza(*R.*id.Marco_de contenido, fragmento).Comete();
    }más {
    }
    rotura;
    caso *R.*id.Cuenta:
    el fragmento = nuevo *AccountMainFragment();
    si (fragmento != *null)
        #unknown{^*getSupportFragmentManager().*beginTransaction()
        .Reemplaza(*R.*id.Marco_de contenido, fragmento).Comete();
    }más
                //#unknown{^*Log.*e("*MainActivity", "Error en crear fragmento");
    }

    rotura;}

Cuándo *i'*m dentro de un fragmento y quiere cambiar a otro fragmento, esto es 
el código:

*SingleProductFragment el fragmento = nuevo *SingleProductFragment();
fragmento.*setArguments(*bundle);*FragmentManager *fragmentManager = (((*AppCompatActivity) Contexto).*getSupportFragmentManager());                      *FragmentTransaction *fragmentTransaction = *fragmentManager.*beginTransaction();
*fragmentTransaction.*addToBackStack("Solo");
*fragmentTransaction.Reemplaza(*R.*id.Marco_de contenido, fragmento);
*fragmentTransaction.Comete();

Cuando dentro de una actividad y necesidad de llamar una actividad, yo  él #por la actividad 
principal :

*Intent *intent = nuevo *Intent(*NotificationListViewActivity.Esto, *AppMainActivity.Clase);
*intent.*putExtra("*FragmentCheck", "solo");
*startActivity(*intent);

-- 
recibiste este mensaje porque eres *subscribed al *Google Grupos "*Android *Developers" grupo.
A *unsubscribe de este grupo y la parón que recibe *emails de él, enviar un *email a *android-*developers+unsubscribe@xxxxxxxxxxxxxxxx.
A correo a este grupo, envía *email a *android-developers@xxxxxxxxxxxxxxxx.
Visita este grupo en *https://grupos.*google.*com/Grupo/*android-*developers.
Para ver esta discusión en la visita de web *https://grupos.*google.*com/*d/*msgid/*android-*developers/*d6*ed9*c83-5*ed1-4*c12-9*e64-*e154*cdc89*aa8%40*googlegroups.*com.
Para más opciones, visita *https://grupos.*google.*com/*d/*optout.
 

I have an app that has a bottom bar with three fragments. There are also a 
few child fragments that are being called from parent fragments. Google 
Play console shows several crashes due to java.lang.IllegalArgumentException. 
I cannot seem to replicate the error, and nothing points to my code in the 
logs. 

Can anybody decipher what could be the problem? 

Here is the error stack trace.

java.lang.RuntimeException: 
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3190)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3300)
at android.app.ActivityThread.access$1000 (ActivityThread.java:211)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1705)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:145)
at android.app.ActivityThread.main (ActivityThread.java:6946)
at java.lang.reflect.Method.invoke (Native Method)
at java.lang.reflect.Method.invoke (Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1199)
Caused by: java.lang.IllegalArgumentException: 
at android.support.v4.app.FragmentManagerImpl.moveToState (FragmentManager.java:1293)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState (FragmentManager.java:1528)
at android.support.v4.app.FragmentManagerImpl.moveToState (FragmentManager.java:1595)
at android.support.v4.app.BackStackRecord.executeOps (BackStackRecord.java:758)
at android.support.v4.app.FragmentManagerImpl.executeOps (FragmentManager.java:2363)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether (FragmentManager.java:2149)
at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps (FragmentManager.java:2103)
at android.support.v4.app.FragmentManagerImpl.execPendingActions (FragmentManager.java:2013)
at android.support.v4.app.FragmentController.execPendingActions (FragmentController.java:388)
at android.support.v4.app.FragmentActivity.onStart (FragmentActivity.java:607)
at android.support.v7.app.AppCompatActivity.onStart (AppCompatActivity.java:178)
at android.app.Instrumentation.callActivityOnStart (Instrumentation.java:1264)
at android.app.Activity.performStart (Activity.java:6613)
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3153)

Shown below is the launcher activity code

public void onMenuItemSelected(int itemId) {Fragment fragment;switch (itemId) {
    case R.id.home:
    fragment = new HomeFragment();
    if (fragment != null) {
        getSupportFragmentManager().beginTransaction()
        .replace(R.id.content_frame, fragment).commit();
    }else {
    }
    break;
    case R.id.profile:

    fragment = new ProfileFragment();
    if (fragment != null) {
        getSupportFragmentManager().beginTransaction()
        .replace(R.id.content_frame, fragment).commit();
    }else {
    }
    break;
    case R.id.account:
    fragment = new AccountMainFragment();
    if (fragment != null) {
        getSupportFragmentManager().beginTransaction()
        .replace(R.id.content_frame, fragment).commit();
    }else {
                //Log.e("MainActivity", "Error in creating fragment");
    }

    break;}

When i'm inside a fragment and want to switch to another fragment, this is 
the code:

SingleProductFragment fragment = new SingleProductFragment();
fragment.setArguments(bundle);FragmentManager fragmentManager = (((AppCompatActivity) context).getSupportFragmentManager());                      FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.addToBackStack("single");
fragmentTransaction.replace(R.id.content_frame, fragment);
fragmentTransaction.commit();

When inside a activity and need to call an activity, I do it through the 
main activity :

Intent intent = new Intent(NotificationListViewActivity.this, AppMainActivity.class);
intent.putExtra("FragmentCheck", "single");
startActivity(intent);

-- 
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to android-developers@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/d6ed9c83-5ed1-4c12-9e64-e154cdc89aa8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Anterior por Tema] Tema Actual [Siguiente por Tema>
  • [android-developers] java.lang.IllegalArgumentException Cuando cambiando fragmentos, Dimple <=