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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:26:25+00:00 2026-06-18T14:26:25+00:00

The main activity of the application is to display a list. The user clicks

  • 0

The main activity of the application is to display a list. The user clicks on something on the list which opens a edit screen. Upon fisnish, the edit screen is closed – and I want the original list to be updated with whatever hapenned on the edit screen. I save the data to a file – and I can just read it again to update the list. However I don’t know where to insert the re-read code.

In the ListActivity – what method is called whe the list gets focus again?

This is my main List activity code:

Creating the view:

@Override
       public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Inflate our UI from its XML layout description.
    setContentView(R.layout.my_activity);

   list=new Data_List(this);  // my data reading class
   list.read_data();           // reads from a file

  load_dynamic_list();

}

Loading the data:

private void load_dynamic_list(){
             ladapter=new         
list_adapter(this,android.R.layout.simple_list_item_1,list);  // the type is actually  ignored                                                                                  // getview function in list_adapter handles everything
          setListAdapter(ladapter);
         this.getListView().invalidate();

}

Something was selected:

protected void onListItemClick (ListView l, View v, int position, long id){
  int a;
   intent = new Intent(this,Editing.class);

        intent.putExtra("New_entry",0);
        intent.putExtra("Entry",position);


        //start the second Activity
        this.startActivity(intent);


 }

In the Editing function I end off like this:

    @Override
public void onClick(View v) {
    // TODO Auto-generated method stub
    if(v.getId() == R.id.button_save){
        do_save();  // saves to a file

  //  I want something like: caller.getListView().invalidate();

         finish();
                    }
    if(v.getId() == R.id.button_cancel){
        finish();
                    }
}

What method can I override or call that will execute when the editing is done? At that point I want to read_data() and then load_dynamic_list() again.

  • 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-06-18T14:26:27+00:00Added an answer on June 18, 2026 at 2:26 pm
     @Override
     protected void onResume() {
          super.onResume();
    
         list=new Data_List(this);
         list.read_data();
               load_dynamic_list();    // becuase whatever was edited needs to be reread. 
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making an android application which has a main activity and several other
For tracking user activity, I am using a Windows Hook for the main application
I'm having difficulties handling multiple instances of my root (main) activity for my application.
In my android application I would like to display items in a list. For
In a game application I have the following scenario: From the main game Activity
I want to display a list of items which has a name Bernadette in
I have used SimpleCursorAdapter for display the data into a list in my activity
I have a code for dictionary application. If user click list item in the
I am developing one application and in which i have to display a five
I have written an android application to display a list. Code has taken from

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.