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 6717219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:49:36+00:00 2026-05-26T08:49:36+00:00

I have two screens the one which list the records in a listview ListView

  • 0

I have two screens the one which list the records in a listview “ListView Screen” & the second which is used for showing a specific record “specific record screen”.
I am using grid_item.xml, which is used to hold the data of a row in the listview.
the grid_item.xml is below:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
        <TextView android:id="@+id/col1"
            android:layout_height="fill_parent"
            android:layout_width="wrap_content"
            android:width="50dip"
        />
        <TextView android:id="@+id/col2"
            android:layout_height="fill_parent"
            android:layout_width="wrap_content"
            android:width="200dip"
        />
        <TextView android:id="@+id/col3"
            android:layout_height="fill_parent"
            android:layout_width="wrap_content"
            android:width="200dip"
        />
       <TextView android:id="@+id/col4"
            android:layout_height="fill_parent"
            android:layout_width="wrap_content"
            android:width="200dip"
        />
        <ImageView android:id="@+id/editimage"
            android:layout_width="30dip"
            android:layout_height="30dip" 
            android:background="@drawable/edit"
            android:clickable="true"
            android:onClick="ClickHandlerForEditImage"
            />  
</LinearLayout>

There is an ImageView which is used to open the “specific record screen” when its clicked. I have attached the “ClickHandlerForEditImage” event to that imageview (see the last few lines of the above xml).

The code:

public void ClickHandlerForEditImage(View v) 
{

    LinearLayout vwParentRow = (LinearLayout)v.getParent();

    TextView txtId = (TextView)vwParentRow.getChildAt(0);

    long rowId =  CommonMethods.GetLong(txtId);

    //Log.d("Inspection", "onItemClick Postion "+ rowId);
    //vwParentRow.refreshDrawableState();      

    if(rowId > 0)
{
       Intent intent = new Intent("com.moftak.db.DatabasesActivity"); 
       intent.putExtra("RecordId", rowId);
       startActivity(intent); 
}

}

Now the problem is that it works fine, the “specific record screen” is opened, but when i press the “back button”, the “ListView Screen” is displayed but the ListView (Or the ListView Items) disappears.

Can somebody help me. Thanks in advance for your valuable time & help.

  • 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-26T08:49:37+00:00Added an answer on May 26, 2026 at 8:49 am

    i found a solution…
    Override the onRestart() & add your code here which is populating the list View in my case it is the LoadInspection().

    @Override 
    public void onRestart() 
    { 
         super.onRestart(); 
         LoadInspections(); 
    }
    

    Can somebody comment on this behavior of List View? Thanks.

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

Sidebar

Related Questions

i am self_learner to android. I have two screens.The first screen contains one edittext
I have two views, one view takes the whole screen, the second view covers
I have two templates for my HTML email: one for bigger screens, and one
I want to have two Emacs windows on the screen: one for Dired and
Suppose I have two fingers touching iPhone's screen but just one is moving. TouchesMoved
I have two activities in my app. One is a list that is presented
I have two screens that are using the same resolution (1280x1024), but one of
Hi I have two screens which I never wanna pop because they load data
I have two JQuery autocomplete's on a screen. One is mandatory, the other is
I have two screens on my app that I want to present to users,

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.