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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:50:36+00:00 2026-05-26T20:50:36+00:00

I am developing a simple game. After every round the results will be displayed.

  • 0

I am developing a simple game. After every round the results will be displayed. In the smartphone version the results will get an own screen (Usually I would use an Activity, which displays a Fragment). In the tablet version the results will be displayed in a dialog. (Usually I would use DialogFragment).

Now I am not sure how to do it correctly. I read a Fragment shouldn’t load another Fragment unless the Fragment is a DialogFragment. But if I use a DialogFragment, I can’t use it to fill the whole screen. (And if it is possible I think that’s actually not the way how it should be done)

I could write a layout “result.xml”, a DialogFragment and an Activity plus Fragment. But this way I have to implements the functions of the results screen twice and as far as I know that is what the Fragment should prevent the developers from.

Is there a best practice for this?

  • 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-26T20:50:37+00:00Added an answer on May 26, 2026 at 8:50 pm

    You don’t need to have a Fragment and a DialogFragment as a DialogFragment can be shown as a dialog or not as the case may be, see API demos sample (something along the lines of ‘FragmentDialogOrActivity’.

    OK so a few ways to do this, keep your DialogFragment and then:

    1. On tablet call show on it to show it as a dialog.
    2. On phone, simpley call replace via FragmentTransaction to replace your ‘DialogFragment’ into the same container as your game fragment.
    3. On phone, create a simple wrapper activity which you can then call via startActivity(ForResult) and have that wrapper call setContentView with simple full screen layout and then add your DialogFragment into the container as per 2 .

    As for which is best practice I don’t necessarily adhere to the view that a fragment shouldn’t load a fragment, particularly if they are closely linked and I don’t see any problems with 2 above for your simple app. Otherwise just go with 3 as it makes little difference.

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

Sidebar

Related Questions

I am developing a simple game on iPhone and I started with a View
I am developing a simple platform game in Java using BlueJ. Over the next
Can anyone recommend a good Java game engine for developing simple tile-based games? I'm
Greetings Friends, I am trying to overlay the simple 2D game I am developing
I'm developing a simple Qt 4 app and making my own dialog. I subclassed
I'm currently developing a simple 2D game for Android. I have a stationary object
I am currently developing a simple Pong game for the iPhone. Currently using CGRectIntersectsRect
I'm developing a web game in pure Python, and want some simple scripting available
I am developing a simple game using Java swing. I want to know whether
I'm developing a simple game that relies heavily on MoviePlayer and supporting both 4.0

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.