gpt4 book ai didi

java - 无法进入下一页

转载 作者:行者123 更新时间:2023-11-30 10:41:56 24 4
gpt4 key购买 nike

我有一个使用 BaseAdapter 类的自定义 listView。我有一个包含 HashMap 列表的数组。这些Hashmaps (String, Object)包括位图和一些字符串(这些字符串可能有HTML标签)。

如果我不在我的 Intent 代码上使用 putExtra 或 putExtra("String", "String"),OnItemClickListener 操作运行良好。但是,当我在 putExtra 中加载 hashMap 时,它会转到上一页而不是下一页。有一件尴尬的事情是,如果位置等于 1,它会毫无问题地转到下一页。否则 (0,2,3,4,5,6..) 返回上一页并处于 Debug模式;在 performItemClick 操作上,mOnItemClickListener 在 AdapterView.java 中返回 null。

这是我的代码:

    // Menu Action
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent = new Intent(ServicesAndProducts.this, ServicesAndProductsDetail.class);
HashMap<String, Object> map = servicesAndProductsList.get(position);
intent.putExtra("SelectedMap", map);
//intent.putExtra("String", "Esra"); // is working

//Bundle extras = new Bundle();
//extras.putSerializable("SelectedMap", servicesAndProductsList.get(position));
//extras.putString("Title", title);
//intent.putExtras(extras);
startActivity(intent);
}

日志:

07-12 11:44:35.083 2675-2675/esrakarakecili.autoking I/Choreographer: Skipped 1736 frames!  The application may be doing too much work on its main thread.
07-12 11:44:35.254 2675-3064/esrakarakecili.autoking D/OpenGLRenderer: endAllStagingAnimators on 0xa4463380 (ListView) with handle 0xaec39b00
07-12 11:44:35.523 4603-4603/esrakarakecili.autoking E/InstantRun: IO Error creating local socket at esrakarakecili.autoking
java.io.IOException: Address already in use
at android.net.LocalSocketImpl.bindLocal(Native Method)
at android.net.LocalSocketImpl.bind(LocalSocketImpl.java:306)
at android.net.LocalServerSocket.<init>(LocalServerSocket.java:48)
at com.android.tools.fd.runtime.Server.<init>(Server.java:94)
at com.android.tools.fd.runtime.Server.create(Server.java:88)
at com.android.tools.fd.runtime.BootstrapApplication.onCreate(BootstrapApplication.java:358)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
at android.app.ActivityThread.access$1500(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
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:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
07-12 11:44:35.688 4603-4603/esrakarakecili.autoking W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
07-12 11:44:35.709 4603-4626/esrakarakecili.autoking D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true

[ 07-12 11:44:35.714 4603: 4603 D/ ]
HostConnection::get() New Host Connection established 0xb42f4a00, tid 4603
07-12 11:44:35.724 4603-4603/esrakarakecili.autoking D/Atlas: Validating map...
07-12 11:44:35.801 4603-4626/esrakarakecili.autoking I/OpenGLRenderer: Initialized EGL, version 1.4
07-12 11:44:35.816 4603-4626/esrakarakecili.autoking D/OpenGLRenderer: Enabling debug mode 0
07-12 11:44:35.825 4603-4626/esrakarakecili.autoking W/EGL_emulation: eglSurfaceAttrib not implemented
07-12 11:44:35.825 4603-4626/esrakarakecili.autoking W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xb4341a40, error=EGL_SUCCESS

最佳答案

我猜你没有正确检索数据。

// To get the object in second Activity
getIntent().getSerializableExtra("SelectedMap");

关于java - 无法进入下一页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38323682/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com