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

  • Home
  • SEARCH
  • 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 7159161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:11:04+00:00 2026-05-28T13:11:04+00:00

This is my first post, so please be nice :) I have a question

  • 0

This is my first post, so please be nice 🙂
I have a question and no one gave the answer in the post I’ve seen.

My app has a list and a button to open an activity, this activity creates a new item to show in the list of the previous activity when pressing the button Create.

How can I do this?

This is the code I made for the first button:

intent = new Intent(this.getBaseContext(), NewTestActivity.class);
this.finish();
startActivity(intent);

and this is the code to go back an refresh:

Intent intent = new Intent(getBaseContext(), TestListActivity.class);                       
startActivity(intent);

But the code to goback is useful, because the activity don’t refresh.
I have to call the new activity in a diferent way? Or go back to previus activity in a diferent way? Or go back normally and refresh the activity when I’m back in the previus activity?

Well…this is all.
Sorry for my bad english and, if this question has been answered in another thread, give me the link to read, because I can’t find it 🙂

PS: I started with android in December.

Thanks for your 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-28T13:11:05+00:00Added an answer on May 28, 2026 at 1:11 pm
    1. When you are going to start new activity you shouldn’t close a current one until you actually need this behaviour. (remove this.finish(); row from your code)
    2. Also you shouldn’t close an active activity manually until you actually need it. When the user presses the “back” button on the device Android pops the previous activity from the “back stack”. Read once more Activity documentation.
    3. According to your description you have a list of elements. So in order to refresh the list you need to update your dataset and notify the list about it by ListView.notifyDataSetChanged() method call.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first post, so please forgive me if this question has been
This is my first post on StackOverflow, so please be gentle... I have some
This is my first post. Please forgive me for asking a basic question as
This is my first post on Stack, so please bear with me if I
This is my first post here. I have a problem. I need to take
Well, this is my first post here and really enjoying the site. I have
This is my first post, and first please forgive me for my poor english.
This is my first post, so please be gentle. I've been playing around with
This is my first post to this website. Here is my question: I want
This is my first post in any forum so please bear with me. I

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.