0

I am looking for an answer to the question that how can we give the result to the application which started my application. I have reffered to many tutorials but they were useless... Any help will be welcomed.

Priyank
  • 37
  • 1
  • 7
  • possible duplicate of [How to manage start activity for result on Android?](http://stackoverflow.com/questions/10407159/how-to-manage-start-activity-for-result-on-android) – Antrromet Oct 19 '14 at 06:11

1 Answers1

0
Intent returnIntent = new Intent();
returnIntent.putExtra("result",result); 
setResult(RESULT_OK,returnIntent);
finish();   

Source: How to manage `startActivityForResult` on Android?

Intent i = new Intent();
i.setAction(Intent.ACTION_EDIT);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_TEXT,"Just some text");
startActivity(i);
Community
  • 1
  • 1
An SO User
  • 24,612
  • 35
  • 133
  • 221
  • Hi there can you help me in one more topic i.e. setting the type of intent using setType() – Priyank Oct 19 '14 at 06:49
  • Okay. `setType()` lets you specify the MIME type of the data that is contained in the intent. Plain text has a MIME type of `text/plain`. Have a look: http://www.sitepoint.com/web-foundations/mime-types-complete-list/ – An SO User Oct 19 '14 at 06:51
  • Can you send me an example .... not a big one but just the matter in setType(____) – Priyank Oct 19 '14 at 06:55
  • Suppose my intent uses the MIME type text/plain the how to define that using setType() thats the question – Priyank Oct 19 '14 at 07:00
  • I covered that in my example :) – An SO User Oct 19 '14 at 07:00