hi i'm trying to send ArrayList throw Bundle to Fragment and i have got this Problem (the problem is caused when getting the ArrayList) and i have tested before sending it's not null , i have send it with
arg.putStringArrayList("lp", li);
and receive it with
ArrayList<String> lil = getArguments().getStringArrayList("lp");
and this is the StackTrace :
04-18 20:43:55.153 17577-17577/com.pfe.elmokhtar.domotique W/System.err﹕ java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.ArrayList android.os.Bundle.getStringArrayList(java.lang.String)' on a null object reference
04-18 20:43:55.153 17577-17577/com.pfe.elmokhtar.domotique W/System.err﹕ at com.pfe.elmokhtar.domotique.DetailFragment.onCreateView(DetailFragment.java:31) 04-18 20:43:55.158 17577-17577/com.pfe.elmokhtar.domotique W/System.err﹕ at android.app.Fragment.performCreateView(Fragment.java:2053) 04-18 20:43:55.158 17577-17577/com.pfe.elmokhtar.domotique W/System.err﹕ at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:894) 04-18 20:43:55.158 17577-17577/com.pfe.elmokhtar.domotique W/System.err﹕ at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067) 04-18 20:43:55.158 17577-17577/com.pfe.elmokhtar.domotique W/System.err﹕ at android.app.BackStackRecord.run(BackStackRecord.java:833) 04-18 20:43:55.158 17577-17577/com.pfe.elmokhtar.domotique W/System.err﹕ at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1452) 04-18 20:43:55.160 17577-17577/com.pfe.elmokhtar.domotique W/System.err﹕ at android.app.FragmentManagerImpl$1.run(FragmentManager.java:447) 04-18 20:43:55.160 17577-17577/com.pfe.elmokhtar.domotique W/System.err﹕ at android.os.Handler.handleCallback(Handler.java:739) 04-18 20:43:55.160 17577-17577/com.pfe.elmokhtar.domotique W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:95) 04-18 20:43:55.160 17577-17577/com.pfe.elmokhtar.domotique W/System.err﹕ at android.os.Looper.loop(Looper.java:135) 04-18 20:43:55.160 17577-17577/com.pfe.elmokhtar.domotique W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:5254) 04-18 20:43:55.160 17577-17577/com.pfe.elmokhtar.domotique W/System.err﹕ at java.lang.reflect.Method.invoke(Native Method) 04-18 20:43:55.160 17577-17577/com.pfe.elmokhtar.domotique W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:372) 04-18 20:43:55.160 17577-17577/com.pfe.elmokhtar.domotique W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898) 04-18 20:43:55.160 17577-17577/com.pfe.elmokhtar.domotique W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
0 comments:
Post a Comment