# Showing A Fragment For A Result

DevFeed: [Showing A Fragment For A Result](<https://devfeed.tech/articles/showing-a-fragment-for-a-result-22837.md>)

Original publisher: [Read original article](<http://androidessence.com/starting-fragment-for-result/>)

Author: Adam McNeilly

Published: 2019-01-04T00:00:00Z

Content type: tutorial

Language: en

Sources: [Android Essence](<https://devfeed.tech/sources/android-essence.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Code](<https://devfeed.tech/topics/code.md>), [App](<https://devfeed.tech/topics/app.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [callback](<https://devfeed.tech/tags/callback.md>), [code](<https://devfeed.tech/tags/code.md>), [fragments](<https://devfeed.tech/tags/fragments.md>), [request](<https://devfeed.tech/tags/request.md>)

## AI overview

This tutorial explains how to return a result between Android fragments using a target fragment. It demonstrates a small two-fragment application in which a name is entered in one fragment and displayed in the previous fragment.

## Source excerpt

A number of developers preach a single activity architecture on Android, which is something I've been trying to move forward to as well. In the process, though, I ran into one tricky problem. I don't have something like startActivityResult for fragments. If you're unfamiliar, startActivityForResult is a method that allows you to launch an activity with a specific request code, and when that activity finishes, your first activity will get a callback in onActivityResult and can do stuff with it. This post is going to walk through how we can achieve that same affect using fragments.