android-dialogfragment

SetText of TextView in DialogFragment from Calling Activity

人走茶凉 提交于 2019-12-08 09:56:48
问题 Building an Android app and having some trouble. I'd appreciate any help! I have created an class that extends DialogFragment (Account_Create_Error) that I call from Activity A. I want to set the TextView field in this DialogFragment from Activity A. I created a method in my dialogfragment public void setError(String message) { TextView error = (TextView)getActivity().findViewById(R.id.message); error.setText(message); } I then use this method in Activity A by doing Account_Create_Error error

How to pass data between multiple Fragments in Android

筅森魡賤 提交于 2019-12-08 07:33:23
问题 In my main Activity, I have a DialogFragment that contains a FragmentTabHost. I have two tabs, one that is a DialogFragment and one that is a ListFragment. When either the 'OK' button is pressed in the inner DialogFragment or when an element in the ListFragment is pressed, I want to pass two Strings (that are entered in two TextView's in the inner DialogFragment and are displayed in each element in the ListFragment) back to the Activity, but I am unsure of how to do this with multiple levels

How to add action bar to a DialogFragment?

♀尐吖头ヾ 提交于 2019-12-07 23:22:07
问题 How to add action bar to a DialogFragment ? I found a way to style an activity to the way we require and then display it as a dialog as in the following link ActionBar in a DialogFragment I need to set an action bar on a proper DialogFragment . Is it possible? 回答1: As Up ActionBar action on DialogFragment indicates: There is no way to attach an ActionBar to the DialogFragment even though you can set the theme of the DialogFragment it will not register as a ActionBar to it, Dialog.getActionBar

Android Dialog fragment eliminate black borders (top & bottom)

夙愿已清 提交于 2019-12-07 16:34:36
问题 Need to eliminate top and bottom borders from a dialog fragment. How do you do it? AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setCancelable(true); LayoutInflater inflater = LayoutInflater.from(activity); View view = inflater.inflate(R.layout.variants_dialog, null); // setup views setupListView(view); ... builder.setView(view); return builder.create(); // HERE I HAVE TOP & BOTTOM BLACK BORDERS This doesnt do nothing: builder.setView(view); AlertDialog result =

How to make a DatePicker with DialogFragment and FragmentManager?

给你一囗甜甜゛ 提交于 2019-12-07 10:58:53
问题 So I have been at this for a while, and I cannot seem to figure it out. I am fairly new at Android development, so bear with me please. I wasn't too familiar with creating a Datepicker and I learned to do it the deprecated way just to get the hang of it. Used this tutorial to get me up to speed: http://developer.android.com/resources/tutorials/views/hello-datepicker.html But now I need to change it, mainly to not use deprecated code, so I looked all around, and I found 2 tutorials, mainly

How to add a fragment to a layout of a DialogFragment?

心已入冬 提交于 2019-12-07 07:01:34
问题 I am having a custom DialogFragment which contains a layout, some UI elements, and a Fragment holder layout. What I need to do is inflate a Content fragment into the holder layout and provide a navigation inside that. On clicking a button inside the added fragment the view will navigate to another view. The fragment will be replaced by another one in the same holder i.e. the contentFragment1 will show some data and on clicking a preview button there will replace contentFragment1 with

onDateChanged method does not seem to work

依然范特西╮ 提交于 2019-12-07 06:07:23
问题 this is my first post and I am trying to create a very simple tasker app, however I am having issues with (what seems to be) the onDateChanged method. It seems that it does not implement the changes even though the dialog pops up normally. There are no errors in the log and i double checked various solutions with similar functionalities, but i could not find something relevant. (minSDK 16, Target 21) Thanks a lot in advance and I am sorry if it is something obvious. public class

how to replace one full-screen dialog fragment with another without showing parent activity?

 ̄綄美尐妖づ 提交于 2019-12-07 04:49:39
问题 I have an Activity that uses a single custom DialogFragment class. Its appearance is data driven, so it can look fairly different from invocation to invocation. It is "full screen", i.e. setStyle(DialogFragment.STYLE_NO_FRAME, android.R.style.Theme); In response to the result of a network call I dismiss() the currently showing instance (if there is one) and show() a new one: final CustomDialogFragment dialog = (CustomDialogFragment) getSupportFragmentManager().findFragmentByTag(DIALOG_TAG

Calling DialogFragment from Fragment

为君一笑 提交于 2019-12-07 03:50:50
问题 I am trying to call a DialogFragment from my Fragment class. I have an ImageView, and would like to call my DialogFragment class in the onClickListener of the ImageView I have set up. I am getting an error in the onClick with the code I have set up trying to call the DialogFragment. I am getting an error on "show" stating "The method show(FragmentManager, String) in the type DialogFragment is not applicable for the arguments (FragmentManager, String)" and an error on "new Instance" stating

Android: Can i show multiple Dialogs one over another? Is there something like Dialog Z-Level?

余生颓废 提交于 2019-12-07 02:51:09
问题 Is it possible to show multiple Dialogs one over another? Is there something like Dialog Z-Level? I am using DialogFragment where user chooses elements, when he comfirms his choice, it is saved to database and sent on server. if the save action fails I would like to inform user with ... another dialog is it possible? And will it not clear off my first dialog? Thanks in advance. 回答1: Indeed, it's possible to show multiple dialog Fragments one inside another one. The z-order depends on the