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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:30:02+00:00 2026-05-19T14:30:02+00:00

Hi I Want to set Data in EditText in onActivityResult() ,I Got Result From

  • 0

Hi
I Want to set Data in EditText in onActivityResult() ,I Got Result From Previous Activity, But I can’t set value into my Current EditText..
Hi ,my code:

public class MyStuff extends Activity {
EditText messageArea;
int baseValue=200;
TextView txtCounter;
Button btnStuffOk;
Button btnStuffCancel;
ImageButton imgBrowse;
private Gallery gallery;
Bitmap myBitmap;
boolean flag=false;
int val=0;
private ArrayList<String> arrayLst=new ArrayList<String>();
protected static final int SELECT_IMAGE = 1;
protected static final int SELECT_URL = 2;
BitmapFactory.Options options = new BitmapFactory.Options();
String url_data="";
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.mystuff);



    imgBrowse.setOnClickListener(new OnClickListener()
    {
        @Override
        public void onClick(View v) {
            Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
            photoPickerIntent.setType("image/*");
             startActivityForResult(
                        new Intent(
                                Intent.ACTION_PICK,
                                  android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI),
                        SELECT_IMAGE);
        }
        });

     gallery = (Gallery) findViewById(R.id.examplegallery);
     gallery.setAdapter(new AddImgAdp(this));

     messageArea=(EditText)findViewById(R.id.editArea01);


     txtCounter=(TextView)findViewById(R.id.txtCounts);

     btnStuffOk=(Button)findViewById(R.id.btnStufftOk);
     btnStuffCancel=(Button)findViewById(R.id.btnStuffCancel);

   messageArea.addTextChangedListener(new TextWatcher() { 


        public void afterTextChanged(Editable s) {
            if(s.toString().length()<1 ||s.toString().length()>200)
            {
                btnStuffOk.setEnabled(false);
            }
            else
            {
                btnStuffOk.setEnabled(true);
            }

                txtCounter.setText(""+(baseValue-s.toString().length()));

        } 
        public void beforeTextChanged(CharSequence s, int start, int count,int after) { 

        } 
        public void onTextChanged(CharSequence s, int start, int before, int count) { 

        } 
}); 
}

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

       switch (requestCode) {

           case  SELECT_IMAGE:
            if (resultCode == Activity.RESULT_OK) {
                //
                break;
            }
           case SELECT_URL:
               if (resultCode == Activity.RESULT_OK) {

                   messageArea.setText(data.getStringExtra("url"));
                   messageArea.setText("this is a test");

                    break;
               }


       } 
    } 
}   

data.getStringExtra("url") shows value .. ,but i cant assign it int Edittext…
Please help Me…

  • 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-19T14:30:03+00:00Added an answer on May 19, 2026 at 2:30 pm

    Make sure your EditText instance is available and accessible into onActivityResult method, then use EditText.setText()

    Additionally, as everyone else is saying, attach some code/error to let us check where the problem is.

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

Sidebar

Related Questions

I have two results from a data set. I want to add both results
I hava a method setData(ArrayList<super> list) , so anyone who want set data can
i want to set my session data in my view but Conditionally, so in
in my application I want set textfield value dynamically coming from header. Here is
I want a set of data from Order files that give me CustomerNumber, Order
I have a range named STATE. I want to set data validation in range
I have a large data set and I want to write a custom merge
I have a set of data and I want to find the biggest and
I have a huge set of data and want to display the data with
I want to stack this type of my data set: PATIENT_ID AA BB CC

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.