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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:20:27+00:00 2026-06-16T17:20:27+00:00

I have an Activity stack like: activity A make something activity A call Activity

  • 0

I have an Activity stack like:

activity A make something

activity A call Activity B (without finish();)

activity B make something

activity B call activity C

activity B finish();

activity C make something

activity C finish();

i would like to update the view of the Acivity A since the modification done by activity C has update the database and maybe i have different things to list in activity A.

if my main activity is like that:

public class MainActivity extends ListActivity {
     private pollDataSource datasource;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        datasource = new pollDataSource(this);
        datasource.open();

        Cursor values = datasource.getAllCategorie();

        String[] categorieColumns =
            {
                MySQLiteHelper.COLUMN_NOME   // Contract class constant containing the word column name

            };


            int[] mWordListItems = { R.id.categoria_label };


        SimpleCursorAdapter adapter = new SimpleCursorAdapter(
                getApplicationContext(),               // The application's Context object
                R.layout.single_list_item,             // A layout in XML for one row in the ListView
                values,                                // The result from the query
                categorieColumns,                      // A string array of column names in the cursor
                mWordListItems,                        // An integer array of view IDs in the row layout
                0);                                    // Flags (usually none are needed)


        setListAdapter(adapter);
    }


    @Override
        protected void onListItemClick(ListView l, View v, int position, long id) {

          TextView textView = (TextView) v.findViewById(R.id.categoria_label); 
          String text = textView.getText().toString(); 

          Intent myIntent = new Intent(MainActivity.this, domandeDiCategoria.class);
          myIntent.putExtra("categoriaName", text);
          myIntent.putExtra("categoriaId", id);
          datasource.close();
          MainActivity.this.startActivity(myIntent);

        }   




    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }




}

have I had to write the onResume()? and make it similar to the onCreate? or i could use the same cursor, the same adapter and so on to “update” the view? what is better?

  • 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-16T17:20:28+00:00Added an answer on June 16, 2026 at 5:20 pm

    1) Define in A activity

    public static int UPDATE_A_ACTIVITY  = 1;
    

    2) startActivityForResult(intentB, A.UPDATE_A_ACTIVITY); // start B from A

    3) startActivityForResult(intentC, A.UPDATE_A_ACTIVITY); // start C from B

    4) and when all is ok in C activity finish C activity and notify A activity, that he should update something

    in C activity:

     finish();
     setResult(RESULT_OK);
    

    5) after calling setResult(RESULT_OK); will called next method in A (write this in A activity):

    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        switch (requestCode) {
        case UPDATE_A_ACTIVITY:
            if (resultCode == RESULT_OK) {
                // update what u want
            }
                break;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an activity that when users press share on a file it would
I have an activity with a spinner which loads a simpleCursorAdaptor. I call another
I have a table that I would like to be able to present ranked
I have a published app and received a stack trace from a crash: android.view.WindowManager$BadTokenException:
I want to make my layout for my first tab something like this: I
I want to finish one activity from another activity, like: In Activity [A], on
I would like my Android app to instantiate it's home screen activity one time
Assume I have an Activity which contains two FrameLayouts (let's call them FrameA and
I have Activity A with android:launchMode=singleTop in the manifest. If I go to Activity
I have Activity with ListView inside it and in the onCreate method of the

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.