How to pass data from an activity to dialog? - android-studio

How to pass data from an activity to dialog?
Refer to the image below for more details:

You need to create a customized alert dialog .
Refer this link for creation of customized alert dialog .
According to your requirement , you need to add text view inside alert dialog with a boundary.
Even you can create a customized layout and set that inside alert dialog.
Passing Data from activity to dialog.Get data from activity , I assume it might be in string or integer format.
use setText() property of textview to pass data from string to textview which is inside alert dialog.

Related

Can I grab and populate a screen made by a programmatically triggered button push?

Am I able to grab a screen that is created by a programmatically triggered button push call and populate it with values?
My specific example is that I want to grab the new e-mail screen that is made when I execute this code:
CRCommunicationDraft graph = PXGraph.CreateInstance<CRCommunicationDraft>();
graph.AddNew.PressButton();
I want to grab the screen created after AddNew.PressButton() is executed. Is there any way to do this?
For this specific case, I think is answered here:
How can I open an editable, sendable e-mail screen with prepopoulated values?
For most cases you want to:
Override the Action Handler of the button. You can use OVERRIDE METHOD button of customization editor for that. In your case override the AddNew action event handler.
Create a new graph instance for your target screen, here it is CREmailActivityMaint.
Assign to or insert a record into the current DataView of that graph, in your case use CREmailActivityMaint.Message DataView.
Redirect to the screen, using PXRedirectHelper class.

Passing information from a dialog to the activity

I want to pass a String from a dialog to the main activity.
Can I do that with an intent? And get the extra with OnResume?

Design Approach for Custom Control in C#

Am Creating a user control which will have a button, textbox and label. And i have created some delegates for Button and Textbox.
Now, i need some properties like assign text, visibility and some
other at runtime. For this whether shall i creating a Button itself
as property (or) creating each property for text and visibility. Which one is a good approach ?
I have created some custom events for Button. Now i have to avoid
the default events which is like OnClick e.t.c. Is it possible ?

Android ViewPager with Dynamic Content on Creation

I have an activity that lists multiple records from a database stored in a data object that are presented in a TableView. When the user taps a row, the object is passed to another activity which will display all of the details. That activity uses a ViewPager to display the information on 5 pages using layout XML files in the instantiateItem method of my custom PagerAdapter class. The ViewPager works fine but I need to be able to "refresh" the pages with the data from the passed object immediately but the views on the pages are not yet available in the onCreate method of the activity. Is there some method to be able to accomplish this.

deriving Dialogs from a custom Dialog using mfc

I am trying to define a custom Dialog Template with certain members such as m_hImage, m_hName, and the m_hIcon in it. I want to then derive Dialogs using this Template.
I am not using any buttons(Ok,cancel etc.) in this template. Do i still need to declare or define OnOk(), OnCancel() etc.
Can anybody tell me what are the other methods I need to declare in this template class?
My goal is to just prepare this template dialog so that each dialog derived from this template contains a icon on the title bar (m_hIcon) , the image (m_hImage) on the upper left corner, and the image name (m_hName) on the upper right corner of dialog.
No, you need not to override any of the methods. You may however need to override OnInitDialog, otherwise you won't have any dialog initialization. This is the overridden method where you can setup the icon for dialog.

Resources