dialog

primefaces close dialog on init don't work

风格不统一 提交于 2020-01-07 08:07:31
问题 Im'using Primefaces 5.0 and I tried to use PF Dialog Framework features, but with some problems. I open a dialog using openDialog() method. In the dialog bean I managed an init() method annotated with @PostConstruct. In that method I read parameters and load a list of records (to bind with a dataTable). All seems work fine... dialog opens, I choose a record , close with closeReturn and so on. But I want that in init(), if a single record was found, I could close immediately the dialog. So I

SDK Android : How to open Shutdown/Reboot dialog for the device

人走茶凉 提交于 2020-01-07 06:16:08
问题 I'm new here. I have a problem, i try to shutdown a 4.2.2 android device (not root). I know that ACTION_SHUTDOWN not works with unroot device. So i want to open the existing shutdown/reboot/airplane dialog, the same we get when we maintain the on/off button. Then the user just have to click shutdown button. I try to create by this way, without result... Intent intent = new Intent(Settings.ACTION_DISPLAY_SETTINGS); // or others settings startActivity(intent); Thanks, 回答1: The is no public sdk

findpreference undefined type

廉价感情. 提交于 2020-01-06 19:43:49
问题 I am trying to set a value to a ListPreference and always get the error message: The method findPreference(String) is undefined for the type new DialogInterface.OnClickListener(){} This is my code: ListPreference lp = (ListPreference) findPreference("enableTranslations"); lp.setValue(""); Thanks 回答1: You simply call findPreference in wrong place (in OnClickListener). Call it in method of class that has findPreference method (PreferenceManager or PreferenceActivity) or on object of such type.

Error calling dialog from Service Android

时光毁灭记忆、已成空白 提交于 2020-01-06 19:35:27
问题 I get the following android exception when I try to open a dialog. 09-20 09:27:46.119: W/System.err(558): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application 09-20 09:27:46.139: W/System.err(558): at android.view.ViewRoot.setView(ViewRoot.java:440) 09-20 09:27:46.139: W/System.err(558): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:181) 09-20 09:27:46.139: W/System.err(558): at android.view.WindowManagerImpl.addView

Modeless dialog keyboard handling (winapi)

僤鯓⒐⒋嵵緔 提交于 2020-01-06 18:36:35
问题 I've got an application with a main window which has a bunch of controls, including the spacebar, which is handled by a simple method called onSpacebar() . On top of that main window, I've got a persistent modeless dialog. I need the spacebar to behave the exact same way, regardless of whether the dialog has focus, or the main window has focus. This dialog is backed by a DialogProc which looks something like this: BOOL CALLBACK DialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {

Modeless dialog keyboard handling (winapi)

坚强是说给别人听的谎言 提交于 2020-01-06 18:36:17
问题 I've got an application with a main window which has a bunch of controls, including the spacebar, which is handled by a simple method called onSpacebar() . On top of that main window, I've got a persistent modeless dialog. I need the spacebar to behave the exact same way, regardless of whether the dialog has focus, or the main window has focus. This dialog is backed by a DialogProc which looks something like this: BOOL CALLBACK DialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {

how to kill all activities in android application?

放肆的年华 提交于 2020-01-06 16:54:42
问题 I want to close total application in android when i click on "NO" Button in Dialog. i have used the following code. protected Dialog onCreateDialog(int id) { switch (id) { case 0: AlertDialog.Builder builder1 = new AlertDialog.Builder(this); builder1.setTitle("GASIMIZER"); builder1.setCancelable(false) .setPositiveButton("YES", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog,int which) { Intent i = new Intent(Finalpage.this,NewproActivity.class);

How to dismis custom dialog from a custom button in dialog?

我怕爱的太早我们不能终老 提交于 2020-01-06 12:41:13
问题 Hi there, @Override protected Dialog onCreateDialog(int id) { AlertDialog.Builder builder = new AlertDialog.Builder(this); inviteView = getLayoutInflater().inflate(R.layout.invite_dialog, null); builder.setView(inviteView); sendSmsButton = (Button) inviteView.findViewById(R.id.sendSMSButton); sendEmailButton = (Button) inviteView.findViewById(R.id.sendEmailButton); builder.setTitle(R.string.invite_callrz_title); sendSmsButton.setOnClickListener(new OnClickListener() { @Override public void

How to dismis custom dialog from a custom button in dialog?

左心房为你撑大大i 提交于 2020-01-06 12:39:23
问题 Hi there, @Override protected Dialog onCreateDialog(int id) { AlertDialog.Builder builder = new AlertDialog.Builder(this); inviteView = getLayoutInflater().inflate(R.layout.invite_dialog, null); builder.setView(inviteView); sendSmsButton = (Button) inviteView.findViewById(R.id.sendSMSButton); sendEmailButton = (Button) inviteView.findViewById(R.id.sendEmailButton); builder.setTitle(R.string.invite_callrz_title); sendSmsButton.setOnClickListener(new OnClickListener() { @Override public void

Communicate between fragment and fragment dialog

僤鯓⒐⒋嵵緔 提交于 2020-01-06 08:51:49
问题 I researched on SO about communicating between fragment and fragment dialog, and I found that setTargetFragment and an interface is an approach. But I get this error when I try to setTargetFragment. The method setTargetFragment(Fragment, int) in the type Fragment is not applicable for the arguments (SettingsDetailsFragment, int). I haven;t use fragments until now and I'm new on android. So i have this fragment: public class SettingsDetailsFragment extends Fragment implements