Versuch zum aufrufen der virtuellen Methode " int java.lang.String.hashCode()'
Ich versuche, die Bilder laden von URL in girdview mit Volley-Bibliothek. Für diese bin ich nach diese tutorial. Wenn ich mein Projekt, es speichert alle URLs, die vom server-Datenbank, und speichern Sie dann in der arraylist. Aber nicht, zeigt die Bilder an. Und ich bin immer java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference
Fehler. Es schadet auch nicht, Punkt für jede Linie die Anzahl der code, wo ich immer diese Fehlermeldung. Siehe unten Logcat Ausgabe :
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference
at com.android.volley.Request.<init>(Request.java:136)
at com.android.volley.toolbox.ImageRequest.<init>(ImageRequest.java:71)
at com.android.volley.toolbox.ImageLoader.get(ImageLoader.java:219)
at com.android.volley.toolbox.ImageLoader.get(ImageLoader.java:171)
at com.android.volley.toolbox.NetworkImageView.loadImageIfNecessary(NetworkImageView.java:141)
at com.android.volley.toolbox.NetworkImageView.onLayout(NetworkImageView.java:190)
at android.view.View.layout(View.java:15596)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)
at android.widget.FrameLayout.onLayout(FrameLayout.java:508)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
at android.widget.GridView.setupChild(GridView.java:1542)
at android.widget.GridView.makeAndAddView(GridView.java:1436)
at android.widget.GridView.makeRow(GridView.java:361)
at android.widget.GridView.fillDown(GridView.java:302)
at android.widget.GridView.fillFromTop(GridView.java:437)
at android.widget.GridView.layoutChildren(GridView.java:1276)
at android.widget.AbsListView.onLayout(AbsListView.java:2148)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)
at android.widget.FrameLayout.onLayout(FrameLayout.java:508)
at android.widget.ScrollView.onLayout(ScrollView.java:1502)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)
at android.widget.FrameLayout.onLayout(FrameLayout.java:508)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
at com.android.internal.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:494)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)
at android.widget.FrameLayout.onLayout(FrameLayout.java:508)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2072)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1829)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1054)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5779)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:550)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
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:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Kann jemand mir helfen, was ist das genaue problem und wie löse ich dieses ?
Möglich, Duplikat der Was ist eine Null-Zeiger-Ausnahme aus, und wie kann ich es beheben?
Nein..Das ist nicht doppelte von dem, Was ist Null-Zeiger....
Sie fordern #hashCode() auf einen null-string.
warum sind Sie so sicher, dass er/Sie nennt? Ich glaube nicht, dass der package-name von ihm/Ihr code wäre
Nein..Das ist nicht doppelte von dem, Was ist Null-Zeiger....
Sie fordern #hashCode() auf einen null-string.
warum sind Sie so sicher, dass er/Sie nennt? Ich glaube nicht, dass der package-name von ihm/Ihr code wäre
com.android...
InformationsquelleAutor Ruchir | 2015-10-13
Du musst angemeldet sein, um einen Kommentar abzugeben.
Sollten Sie prüfen, die null-Werte für das Bild, wo Sie bekommen die Daten vom server.
InformationsquelleAutor Avanish Singh
Erste string-Wert als null, für diese Instanz zeigt, String.hashcode () - Fehler
InformationsquelleAutor Gopi Cg
Hatte ich dasselbe problem. Gerade gefunden ein Update, denke ich. In der Verknüpfung zu dem server, den Sie versuchen zu kommunizieren, mit, geben Sie das Protokoll für die Kommunikation ich.e "http://" oder "https://" vor dem hinzufügen der Domäne und allen. Dass es fest für mich. Ich hoffe, es hilft
InformationsquelleAutor Gikid
Ich hatte diesen Fehler in einem anderen Inhalten und fixiert es durch eine Aktualisierung des Android-SDK, Android Studio.
Vielleicht ist es zu helfen.
InformationsquelleAutor Kay
Check-up Ihr manifest. stellen Sie sicher, verwendet, Erlaubnis internet schreiben.
InformationsquelleAutor Nanda R.M stikom