Autore Topic: Errore Java.lang.NullPointerException  (Letto 420 volte)

Offline pezzo

  • Nuovo arrivato
  • *
  • Post: 1
  • Respect: 0
    • Mostra profilo
  • Dispositivo Android:
    samsung galaxy s3
  • Sistema operativo:
    windows 8.1
Errore Java.lang.NullPointerException
« il: 06 Maggio 2015, 11:56:35 CEST »
0
Salve, spero sia nella sezione giusta dato che riguarda i Fragment. Ma andiamo subito al problema, la mia applicazione si blocca alla riga 95 dando il seguente errore Java.lang.NullPointerException

Questo è il logcat:

05-06 11:40:59.538: E/AndroidRuntime(16200): FATAL EXCEPTION: main
05-06 11:40:59.538: E/AndroidRuntime(16200): Process: it.soft2000.COM, PID: 16200
05-06 11:40:59.538: E/AndroidRuntime(16200): java.lang.NullPointerException
05-06 11:40:59.538: E/AndroidRuntime(16200):    at it.soft2000.COM.Fragment_contenitore_tutti.onCreateView(Fragment_contenitore_tutti.java:95)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.support.v4.app.Fragment.performCreateView(Fragment.java:1786)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:953)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1136)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:739)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1499)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:488)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.support.v4.view.ViewPager.populate(ViewPager.java:1073)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.support.v4.view.ViewPager.populate(ViewPager.java:919)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1441)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.view.View.measure(View.java:17478)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:719)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:455)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.view.View.measure(View.java:17478)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5363)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.view.View.measure(View.java:17478)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5363)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:412)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.view.View.measure(View.java:17478)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5363)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2548)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.view.View.measure(View.java:17478)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2266)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1395)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1594)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1253)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6596)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.view.Choreographer.doCallbacks(Choreographer.java:603)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.view.Choreographer.doFrame(Choreographer.java:573)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.os.Handler.handleCallback(Handler.java:733)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.os.Handler.dispatchMessage(Handler.java:95)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.os.Looper.loop(Looper.java:136)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at android.app.ActivityThread.main(ActivityThread.java:5476)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at java.lang.reflect.Method.invokeNative(Native Method)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at java.lang.reflect.Method.invoke(Method.java:515)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
05-06 11:40:59.538: E/AndroidRuntime(16200):    at dalvik.system.NativeStart.main(Native Method)

Questo il codice:

Codice (Java): [Seleziona]
public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState)
    {
        typeViewBulk =0;
                if (getArguments()!= null)
                        typeViewBulk = getArguments().getInt(ARG_SECTION_NUMBER);
                  view = inflater.inflate(R.layout.fragment_contenitore_tutti, container, false);
                listView = (ListView) view.findViewById(R.id.fragment_contenitori_tutti);                        
               
/*Riga 95 */          adapter= new ContenitoreAdapter(view.getContext(), R.layout.layout_listacontenitore, Application.CurrentCantina.getContenitori(contenitoreActivity.searchFilter, typeViewBulk -1));
        listView.setAdapter(adapter);
               
                listView.setOnItemClickListener(mlistView);
               
                mSelectedPos=-1;
                SelectedContenitore=null;
       
        return view;
       
    }
« Ultima modifica: 06 Maggio 2015, 17:21:28 CEST da pezzo »