• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How to setup Dialog box ?

omerjerk

Lurker
Oct 7, 2012
2
0
I want to create a dialog box where a paragraph is written using ScrollView and a close button ...

The dialog should be opened from the main activity by clicking on a button ..

Can you guys provide me necessary xml and java code for this ??

A nice tutorial is always appreciated ... :)
 
You were not very clear...but it sounds like you want to pop up a dialog box from an activity, solicit input in the dialog box, then return the data you solicited in the dialog box to the activity so that you can do something with it.

I did that about two weeks ago. I used these two tutorials as a basis:

Opening a DailogFragment on an item click in Android | Knowledge by Experience

^For making a fragment dialog box with a custom view.

Implementing Custom Alert DialogFragments :: AruSahni.net

^For making a fragment dialog/alert box with said custom view, and collecting/returning input.

It's a pretty big chunk of code and XML to post...so try those two tutorials...if you are still confused afterwards, let me know and I will post my code and XML.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones