Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 782735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:25:58+00:00 2026-05-14T20:25:58+00:00

My application show a ListView with a button which allow user to add an

  • 0

My application show a ListView with a button which allow user to add an element. When the user clicks on this button, another Activity is started to allow user to populate the new element. When the add is finished, we return to the previous Activity with the ListView and I would like to scroll to the new element.
Note that this element is not necessarily at the end of the ListView because there is an “order by” when I retrieve the datas from the database.

I know I need the cursor position of the new element to make the ListView scrool to it, but the only info I have about this element is its id, so how to convert this id to cursor position ? Do I have to loop on the cursor to find the position ?

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T20:25:59+00:00Added an answer on May 14, 2026 at 8:25 pm

    If I had this right your activity is returning the new elements and than you fetch again all entries from database and the only info you have is the id of the elements. If this is the scenario i think that the only option is to iterate all elements in the adapter and to find the right one. But in this case maybe it’s better to use ArrayAdapter. When the second activity returns the new ids, fetch only them from db and then add them to the adapter. You can override add(T) method by implementing insert sort, so your adapter will be sorted and you can store the index of newly inserted elements and then just scroll to this position.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have created an application which show data from user current location. I want
I've an application in which i want to show a list view that is
I am making an android application to show the position of a user on
I have a Windows Form application. What this application does, is let the user
I have a C# WinForm application where I am using a ListView to show
I'm building an ASP.NET application. I'm using a ListView to show some Entities however
I have an application which downloads some data and I want to show that
i've built a chat application. inside my chat messages Activity, i have a ListView
I'm developing one android application in which I'm using one customized ListView which extends
I have a GUI application that has a ListView. It is used to show

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.