Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Why is my listview not returning me to my DetailActivity.class when I'm clicking an item on listview

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having trouble with my ListView. It always sends me back to my login page whenever I press an item on the list. It supposed to go to the details page.


I learned this code on a youtube channel and I know i followed the instructions well and I'm always checking the intent and still the problem is there. Thank you Guys in advance.

This is my DetailActivity.class. Does this have my problem?


Android Manifest

Product Class

The error is that the Product cannot be cast to
Posts: 322
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Batz,

Welcome to the Ranch!

In order to cast to Serializable, your Product class must implement the Serializable interface:

As objects within the Intent wrapper could be passed across Threads during the startActivity call, the objects needs to be in a data transferable state. That's where Serialization comes into play. For more information, consider reviewing:

I'll add that using the Serializable interface in Android isn't a great idea. Serializable has a lot of baggage that in the resource limited Android world can slow down your app. Android has it's own, much more lightweight, version of Serializable called Parcelable. It's a bit tricky to implement, however, with lots of boilerplate code (google "parcelable generator" for sites that can help with that).
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic