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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:36:39+00:00 2026-06-05T23:36:39+00:00

I have a dialog preference with a button on it that I want to

  • 0

I have a dialog preference with a button on it that I want to have open another activity. When that activity is complete, I want the dialog to update a textview (in the dialog) with the information that was gathered from the activity.

In other words:
Preference screen –> Dialog preference –> Dialog –> Button click event –> Activity

I used to have a normal activity call the activity (Activity –> Button click –> Activity) so I could use startactivityforresult, and then call my syncgui function from “onactivityresult”. Sadly, the Dialog preference is not an activity, and therefore can only use startactivity (from context), not startactivityforresult (from activity).

Is there any other way I can tell my dialog that the activity it started is done and that it can update the textview? Here are the original functions

Old parent activity:

public void onClick(View v) {
        if(v == mSimModeBrowse) {
            Intent i = new Intent("com.shared.FileChooser");
            i.putExtra("com.shared.FileChooser.EXTRA_PATH", vsbPath);
            i.putExtra("com.shared.FileChooser.EXTRA_EXTENSIONS", vsbExtensions);
            startActivityForResult(i,0);
        }
    }

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if(resultCode == RESULT_OK) {
            final String file = data.getExtras().getString("com.shared.FileChooser.EXTRA_RESULT");
            mSimModePath.setText(file);
        }
    }

from filechooser (child activity):

@Override
    protected void onListItemClick(ListView l, View v, int position, long id) {
        File f = new File(path + "/" + files.get(position));
        Intent i = new Intent();
        i.putExtra(EXTRA_RESULT,f.getAbsolutePath());
        setResult(RESULT_OK,i);
        finish();
    }
  • 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-05T23:36:41+00:00Added an answer on June 5, 2026 at 11:36 pm

    Have you tried using:

    runOnUiThread(new Runnable() { 
        public void run() 
        { 
            Intent i = new Intent("com.shared.FileChooser");
            i.putExtra("com.shared.FileChooser.EXTRA_PATH", vsbPath);
            i.putExtra("com.shared.FileChooser.EXTRA_EXTENSIONS", vsbExtensions);
    
            startActivityForResult(i,0);
        } 
     }); 
    

    inside your Dialog’s onClick event? That should cause it to run on the UI thread of the Activity.

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

Sidebar

Related Questions

I have a dialog that I want to place within another dialog and position
I have a Dialog which depends on information from the current view. This works
I have a preference screen that is populated with items from a database. I
I have a simple Activity that uses a android:theme=@android:style/Theme.Dialog in the manifest. My activity
I have an Activity in which user can update a specific information clicking in
I have a dialog box with controls that is popped up and when a
I have a gridview in an update panel and am using a jQuery dialog
I have a standard jQuery UI dialog. Inside that dialog, I have a custom
I have a relatively simple layout that contains an EditText . The activity itself
I have a jQuery UI Dialog Box that contains a jQuery UI Autocomplete input

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.