Java 类android.content.DialogInterface.OnDismissListener 实例源码

项目:open-rmbt    文件:RMBTTestFragment.java   
protected void showErrorDialog(int errorMessageId)
{
    stopLoop = true;

    final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    builder.setTitle(R.string.test_dialog_error_title);
    builder.setMessage(errorMessageId);
    builder.setNeutralButton(android.R.string.ok, null);
    dismissDialogs();
    errorDialog = builder.create();
    errorDialog.setOnDismissListener(new OnDismissListener()
    {
        @Override
        public void onDismiss(DialogInterface dialog)
        {
            final RMBTMainActivity activity = (RMBTMainActivity) getActivity();
            if (activity != null)
                activity.getSupportFragmentManager().popBackStack();
        }
    });
    errorDialog.show();
}
项目:ThunderMusic    文件:MixRadioActivity.java   
@Override
protected void onPreExecute() {
    // 

    mProgressDialog = new ProgressDialog(context,
            ProgressDialog.THEME_DEVICE_DEFAULT_LIGHT);
    mProgressDialog.setTitle("");
    mProgressDialog.setMessage(activity
            .getString(R.string.mixradio_dialog));

    mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    mProgressDialog.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss(DialogInterface dialog) {
            // 
            mTask.cancel(true);
        }
    });
    mProgressDialog.show();
    super.onPreExecute();
}
项目:LibreTasks    文件:ActivityDlgActionInput.java   
/**
 * Show the attributes dialog for the specified {@code viewItem} if applicable
 * 
 * @param viewItem
 *          the item chosen to show the attributes
 */
private void showDialogAttributes(final ViewItem viewItem) {

  ArrayList<ModelAttribute> attributesValid = (ArrayList<ModelAttribute>) getAttributes(viewItem);
  // Show the dialog finally if they have any choice.
  if (!attributesValid.isEmpty()) {
    DlgAttributes dlg = new DlgAttributes(this, attributesValid);
    dlg.setOnDismissListener(new OnDismissListener() {
      public void onDismiss(DialogInterface dialog) {
        // Fetch the attribute they chose, if any.
        ModelAttribute modelAttribute = ((DlgAttributes) dialog).getSelectedAttribute();

        if (modelAttribute != null) {
          viewItem.insertAttribute(modelAttribute);
        }
      }
    });
    dlg.show();
  } else {
    // Shouldn't happen but leaving in for safety
    UtilUI.showAlert(this, "Sorry!",
        "There are no matching parameters for the selected attribute type!");
  }
}
项目:foursquared    文件:BadgesActivity.java   
@Override
protected Dialog onCreateDialog(int id) {
    switch (id) {
        case DIALOG_ID_INFO:
            AlertDialog dlgInfo = new AlertDialog.Builder(this)
                .setTitle(mStateHolder.getDlgInfoTitle())
                .setIcon(0)
                .setMessage(mStateHolder.getDlgInfoMessage()).create();
            dlgInfo.setOnDismissListener(new OnDismissListener() {
                public void onDismiss(DialogInterface dialog) {
                    removeDialog(DIALOG_ID_INFO);
                }
            });
            try {
                Uri icon = Uri.parse(mStateHolder.getDlgInfoBadgeIconUrl());
                dlgInfo.setIcon(new BitmapDrawable(((Foursquared) getApplication())
                        .getRemoteResourceManager().getInputStream(icon)));
            } catch (Exception e) {
                Log.e(TAG, "Error loading badge dialog!", e);
                dlgInfo.setIcon(R.drawable.default_on);
            }
            return dlgInfo;
    }
    return null;
}
项目:Wei.Lib2A    文件:Prompt.java   
/**弹出窗口消失会发送该事件**/
public synchronized static void setOnDismissListener(OnDismissListener l) {
    if(mOnDismissListener == l) return;
    final OnDismissListener oldListnener = mOnDismissListener;
    mOnDismissListener = l;
    if(oldListnener != null) {
        final MyDialog dialog = MyDialog.get();
        if(dialog != null) {
            if(mUiThread != Thread.currentThread()) {
                if(mHandler != null) mHandler.post(new Runnable() {
                    @Override
                    public void run() {
                        oldListnener.onDismiss(dialog);
                    }
                });
            }else {
                oldListnener.onDismiss(dialog);
            }
        }
    }
}
项目:S4-challenge    文件:VoiceActivity.java   
private void createListeningDialog() {
    _listeningDialog = new ListeningDialog(this);


    _listeningDialog.setOnDismissListener(new OnDismissListener() {
        @Override
        public void onDismiss(DialogInterface dialog) {
            if (_currentRecognizer != null) // Cancel the current recognizer
            {
                _currentRecognizer.cancel();
                _currentRecognizer = null;
            }

            if (!_destroyed) {
                VoiceActivity.this.removeDialog(LISTENING_DIALOG);
                createListeningDialog();
            }
        }
    });
}
项目:PdDroidPublisher    文件:PopupTaplist.java   
@Override
public boolean touchdown(int pid, float x, float y) {

    if (dRect.contains(x, y)) {
        final Selector selector = new Selector(parent.getContext(), getValues());

        selector.setOnDismissListener(new OnDismissListener() {             
            @Override
            public void onDismiss(DialogInterface dialog) {
                Integer v = selector.getSelectedValue();
                if (v != null){
                    val = v;
                    doSend();
                    parent.threadSafeInvalidate();
                }
                dialog.dismiss();
            }
        }); 
        selector.show();
        return true;
    }
    return false;
}
项目:PdDroidPublisher    文件:Numberbox.java   
private void openEditDialog()
{
    final NumberboxDialog editDialog = new NumberboxDialog(parent.getContext(), val);
    editDialog.setTitle(label == null ? "Edit number" : label);
    editDialog.setOnDismissListener(new OnDismissListener() {
        @Override
        public void onDismiss(DialogInterface dialog) {
            Float selectedValue = editDialog.getSelectedValue();
            if(selectedValue != null)
            {
                setval(selectedValue.floatValue());
                sendFloat(val);
                parent.invalidate();
            }
        }
    });
    editDialog.show();
}
项目:PdDroidPublisher    文件:Symbol.java   
private void openEditDialog()
{
    final SymbolDialog editDialog = new SymbolDialog(parent.getContext(), value);
    editDialog.setTitle(label == null ? "Edit symbol" : label);
    editDialog.setOnDismissListener(new OnDismissListener() {
        @Override
        public void onDismiss(DialogInterface dialog) {
            String selectedValue = editDialog.getSelectedValue();
            if(selectedValue != null)
            {
                setValue(selectedValue);
                parent.invalidate();
            }
        }
    });
    editDialog.show();
}
项目:yelo-android    文件:RatingDialogFragment.java   
@Override
public void onAttach(final Activity activity) {

    super.onAttach(activity);

    if (activity instanceof OnClickListener) {
        mClickListener = (OnClickListener) activity;
    }

    else {
        throw new IllegalStateException("Activity must implement DialogInterface.OnClickListener");
    }

    if (activity instanceof OnDismissListener) {
        mOnDismissListener = (OnDismissListener) activity;
    }
}
项目:yelo-android    文件:SingleChoiceDialogFragment.java   
@Override
public void onAttach(final Activity activity) {

    super.onAttach(activity);

    if (activity instanceof OnClickListener) {
        mClickListener = (OnClickListener) activity;
    }

    else {
        throw new IllegalStateException("Activity must implement DialogInterface.OnClickListener");
    }

    if (activity instanceof OnDismissListener) {
        mOnDismissListener = (OnDismissListener) activity;
    }
}
项目:OpeningHoursFragment    文件:OpeningHoursFragment.java   
/**
 * Show a list of the templates in the database, selection will either load a template or start the edit dialog on
 * it
 * 
 * @param context Android context
 * @param manage if true the template editor will be started otherwise the template will replace the current OH
 *            value
 */
void loadOrManageTemplate(Context context, boolean manage) {
    AlertDialog.Builder alertDialog = new AlertDialog.Builder(context);
    View templateView = (View) inflater.inflate(R.layout.template_list, null);
    alertDialog.setTitle(manage ? R.string.manage_templates_title : R.string.load_templates_title);
    alertDialog.setView(templateView);
    ListView lv = (ListView) templateView.findViewById(R.id.listView1);
    final SQLiteDatabase writableDb = new TemplateDatabaseHelper(context).getWritableDatabase();
    templateCursor = TemplateDatabase.queryByKey(writableDb, manage ? null : key);
    templateAdapter = new TemplateAdapter(writableDb, context, templateCursor, manage);
    lv.setAdapter(templateAdapter);
    alertDialog.setNegativeButton(R.string.Done, null);
    alertDialog.setOnDismissListener(new OnDismissListener() {
        @Override
        public void onDismiss(DialogInterface dialog) {
            templateCursor.close();
            writableDb.close();
        }
    });
    templateDialog = alertDialog.show();
}
项目:Lulu    文件:MyFragment.java   
private void showDialog() {
    final MaterialDialog materialDialog = new MaterialDialog(mContext);
    materialDialog.setCanceledOnTouchOutside(true);
    materialDialog.setMessage("这里是用来展示的文字信息的东西").setTitle("标题").setPositiveButton("确定", new OnClickListener() {
        @Override
        public void onClick(View v) {
            materialDialog.dismiss();
        }
    }).setNegativeButton("取消", null);
    materialDialog.setOnDismissListener(new OnDismissListener() {
        @Override
        public void onDismiss(DialogInterface dialog) {
            Toast.makeText(mContext, "运行到关闭了", Toast.LENGTH_SHORT).show();
        }
    });
    materialDialog.show();
}
项目:freeiot-android    文件:CommonUtils.java   
public static final void showProgressDialog(Context context, String title,
        String message, OnDismissListener onDismissListener) {
    if (context == null) {
        return;
    }
    dismissDialog();
    if (TextUtils.isEmpty(title)) {
        title = "";
    }
    if (TextUtils.isEmpty(message)) {
        message = context.getString(R.string.loading);
    }
    mProgressDialog = ProgressDialog.show(context, title, message);
    mProgressDialog.setCancelable(true);
    mProgressDialog.setCanceledOnTouchOutside(false);
    mProgressDialog.setOnDismissListener(onDismissListener);
}
项目:M3UPlayer    文件:Player.java   
private void browse() {
    if (mBrowser == null) {
        mBrowser = FileBrowser.createFileBrowser(this, "/", ".m3u", new OnFileSelectedListener() {

            @Override
            public void onFileSelected(String path) {
                prepareData(path);
                if (mBrowser != null && mBrowser.isShowing()) {
                    mBrowser.dismiss();
                }
            }
        });
        mBrowser.setOnDismissListener(new OnDismissListener() {

            @Override
            public void onDismiss(DialogInterface dialog) {
                mBrowse.requestFocus();
            }
        });
    }
    mBrowser.show();
}
项目:JVC-Forums-Reader    文件:PmTopicActivity.java   
public void pmTopicSeeAllPreviousMessagesClick(View view)
{
    seeAllMessagesDialog = new ProgressDialog(this);
    seeAllMessagesDialog.setCancelable(true);
    seeAllMessagesDialog.setOnDismissListener(new OnDismissListener()
    {
        @Override
        public void onDismiss(DialogInterface dialog)
        {
            stopLoadingAllMessages = true;
        }
    });
    seeAllMessagesDialog.setTitle(R.string.genericLoading);
    seeAllMessagesDialog.setIndeterminate(true);
    seeAllMessagesDialog.setMessage(String.format(getString(R.string.pmTopicLoadedMessages), 0));
    seeAllMessagesDialog.show();

    allMessagesCounter = 25;
    currentPage++;
    loadPreviousMessages(true);
}
项目:sturesy-android-client    文件:VotingActivity.java   
/**
 * Displays a dialog to select question sets for voting. Loads selected
 * question set and sets UI to display values.
 */
private void loadQuestion() {
    if (!_isVotingRunning)
    {
        String title = getString(R.string.load_question_set);
        final FileImportDialog dialog = new FileImportDialog(this,
                new NameXMLFileFilter(), title);
        dialog.setOnDismissListener(new OnDismissListener() {

            @Override
            public void onDismiss(DialogInterface dialog2) {
                setCurrentFile(dialog.getSelectedFile());
                if (_currentFile != null)
                {
                    readFile(_currentFile);
                }
            }
        });
        dialog.show();
    }
}
项目:sturesy-android-client    文件:VotingAnalysisActivity.java   
/**
 * Opens a dialog to choose the voting results from. Triggers file
 * processing, if a valid file has been selected.
 */
private void openResults() {
    String title = getString(R.string.title_load_votes);
    final FileImportDialog dialog = new FileImportDialog(this,
            new LectureFileFilter(), title);
    dialog.setOnDismissListener(new OnDismissListener() {
        @Override
        public void onDismiss(DialogInterface dialog2) {
            File f = dialog.getSelectedFile();
            if (f != null)
            {
                readFile(f);
            }
        }
    });
    dialog.show();
}
项目:sturesy-android-client    文件:SingleQuestionFragment.java   
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
        long id) {
    final int selectedPosition = position;
    final TextInputDialog input = new TextInputDialog(getActivity(),
            getString(R.string.enter_answer));
    input.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss(DialogInterface dialog) {
            String updatedText = input.getText();
            if (!updatedText.equals(""))
            {
                _questionModel.getAnswers().set(selectedPosition,
                        updatedText);
                _answerAdapter.notifyDataSetChanged();
            }
        }
    });
    input.setInputText(_questionModel.getAnswers().get(selectedPosition));
    input.show();
}
项目:sturesy-android-client    文件:MultipleQuestionFragment.java   
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
        long id) {
    final int selectedPosition = position;
    final TextInputDialog input = new TextInputDialog(getActivity(),
            getString(R.string.enter_answer));
    input.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss(DialogInterface dialog) {
            String updatedText = input.getText();
            if (!updatedText.equals(""))
            {
                _questionModel.getAnswers().set(selectedPosition,
                        updatedText);
                _answerAdapter.notifyDataSetChanged();
            }
        }
    });
    input.setInputText(_questionModel.getAnswers().get(selectedPosition));
    input.show();
}
项目:sturesy-android-client    文件:QuestionGeneratorActivity.java   
/**
 * Method to import qti questions and add them to the current questionset.
 */
private void importQTI() {
    String title = getString(R.string.qti_import);
    final FileImportDialog dialog = new FileImportDialog(this,
            new ZipFileFilter(), title);
    dialog.setOnDismissListener(new OnDismissListener() {
        @Override
        public void onDismiss(DialogInterface dialog2) {
            setQtiFile(dialog.getSelectedFile());
            if (_qtiFile != null)
            {
                QTIImportService qtiService = new QTIImportService();
                QuestionSet questions = qtiService.getQuestions(_qtiFile);
                for (QuestionModel questionModel : questions)
                {
                    _currentQuestionset.addQuestionModel(questionModel);
                }
                _questionAdapter.notifyDataSetChanged();
                // Check if qti import was 100% successful
                checkQTIAfterImport(qtiService, questions);
            }
        }
    });
    dialog.show();
}
项目:sturesy-android-client    文件:QuestionGeneratorActivity.java   
/**
 * Opens a dialog to select previously saved questions. Loads them after
 * selection.
 */
private void loadQuestion() {
    String title = getString(R.string.load_question_set);
    final FileImportDialog dialog = new FileImportDialog(this,
            new NameXMLFileFilter(), title);
    dialog.setOnDismissListener(new OnDismissListener() {
        @Override
        public void onDismiss(DialogInterface dialog2) {
            File f = dialog.getSelectedFile();
            if (f != null)
            {
                setCurrentFile(f);
                readFile(_currentFile);
            }
        }
    });
    dialog.show();
}
项目:androsgi    文件:OSGiHelper.java   
private static void showErrorDialog(Exception e, android.content.Context androidContext){
    // show a dialog
    AlertDialog alertDialog = new AlertDialog.Builder(
               androidContext).create();
    alertDialog.setTitle("Error starting application");
    alertDialog.setMessage("Failed to start the OSGi runtime \n"
            +e.getMessage());

    alertDialog.setOnDismissListener(new OnDismissListener() {
        @Override
        public void onDismiss(DialogInterface dialog) {
            System.exit(-1);
        }
    });
    alertDialog.show();
}
项目:barterli_android    文件:AddUserInfoDialogFragment.java   
@Override
public void onAttach(final Activity activity) {

    super.onAttach(activity);

    if (activity instanceof OnClickListener) {
        mClickListener = (OnClickListener) activity;
    }

    else {
        throw new IllegalStateException("Activity must implement DialogInterface.OnClickListener");
    }

    if (activity instanceof OnDismissListener) {
        mOnDismissListener = (OnDismissListener) activity;
    }
}
项目:barterli_android    文件:AlertDialogFragment.java   
@Override
public void onAttach(final Activity activity) {

    super.onAttach(activity);

    if (activity instanceof OnClickListener) {
        mClickListener = (OnClickListener) activity;
    }

    else {
        throw new IllegalStateException("Activity must implement DialogInterface.OnClickListener");
    }

    if (activity instanceof OnDismissListener) {
        mOnDismissListener = (OnDismissListener) activity;
    }
}
项目:barterli_android    文件:AddSingleEditTextDialogFragment.java   
@Override
public void onAttach(final Activity activity) {

    super.onAttach(activity);

    if (activity instanceof OnClickListener) {
        mClickListener = (OnClickListener) activity;
    }

    else {
        throw new IllegalStateException("Activity must implement DialogInterface.OnClickListener");
    }

    if (activity instanceof OnDismissListener) {
        mOnDismissListener = (OnDismissListener) activity;
    }
}
项目:barterli_android    文件:EnableLocationDialogFragment.java   
@Override
public void onAttach(final Activity activity) {

    super.onAttach(activity);

    if (activity instanceof OnClickListener) {
        mClickListener = (OnClickListener) activity;
    }

    else {
        throw new IllegalStateException("Activity must implement DialogInterface.OnClickListener");
    }

    if (activity instanceof OnDismissListener) {
        mOnDismissListener = (OnDismissListener) activity;
    }
}
项目:barterli_android    文件:SingleChoiceDialogFragment.java   
@Override
public void onAttach(final Activity activity) {

    super.onAttach(activity);

    if (activity instanceof OnClickListener) {
        mClickListener = (OnClickListener) activity;
    }

    else {
        throw new IllegalStateException("Activity must implement DialogInterface.OnClickListener");
    }

    if (activity instanceof OnDismissListener) {
        mOnDismissListener = (OnDismissListener) activity;
    }
}
项目:AccelerationAlert    文件:AccelerationAlertActivity.java   
/**
 * Show a dialog with the acceleration event settings.
 */
private void showSettingsDialog()
{
    SettingsDialog dialog = new SettingsDialog(this);

    dialog.setOnDismissListener(new OnDismissListener()
    {
        @Override
        public void onDismiss(DialogInterface arg0)
        {
            // Read the new preferences.
            readPrefs();
        }
    });

    dialog.show();
}
项目:chessonline    文件:CPUWarning.java   
@Override
protected Dialog onCreateDialog(int id) {
    switch (id) {
    case CPU_WARNING_DIALOG:
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle(R.string.app_name).setMessage(R.string.cpu_warning);
        AlertDialog alert = builder.create();
        alert.setOnDismissListener(new OnDismissListener() {
            public void onDismiss(DialogInterface dialog) {
                finish();
            }
        });
        return alert;
    }
    return null;
}
项目:TurkcellUpdater_android_sdk    文件:UpdaterDialogManager.java   
/**
 * Creates a dialog for given message.
 *
 * @param activity        Parent activity.
 * @param message         Message contents
 * @param dismissListener Listener that will be called when dialog is closed or
 *                        cancelled.
 * @return Created dialog.
 */
public static Dialog createMessageDialog(Activity activity, Message message, OnDismissListener dismissListener) {
    final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
    final String title = message.description == null ? null : message.description.get(MessageDescription.KEY_TITLE);
    if (!Utilities.isNullOrEmpty(title)) {
        builder.setTitle(title);
    }
    final View dialogContentsView = createMessageDialogContentsView(activity, message.description);
    builder.setView(dialogContentsView);
    initializeMessageDialogButtons(activity, builder, message);
    builder.setCancelable(true);
    final AlertDialog dialog = builder.create();
    if (Utilities.isNullOrEmpty(title)) {
        dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    }
    dialog.setOnDismissListener(dismissListener);
    return dialog;
}
项目:Divide_And_Conquer_Card_Shuffler    文件:ShufflerFragment.java   
private Dialog createDialogInstructions(String title, String msg, String buttonText, OnDismissListener onDismiss) {
    // Use the custom instruction layout for the dialog.
    LayoutInflater inflater = (LayoutInflater) mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    LinearLayout layoutInstructions =
            (LinearLayout) inflater.inflate(R.layout.linearlayout_instructions, null, false);

    TextView textViewMessage = (TextView) layoutInstructions.findViewById(R.id.TextViewDialogInstructions);
    Button buttonOK = (Button) layoutInstructions.findViewById(R.id.ButtonDialogInstructionsOK);

    Dialog dialog = new Dialog(mActivity);
    dialog.getWindow().setBackgroundDrawableResource(R.color.background_dialog);
    dialog.setContentView(layoutInstructions);
    dialog.setTitle(title);
    dialog.setOnDismissListener(onDismiss);
    textViewMessage.setText(msg);
    buttonOK.setText(buttonText);
    buttonOK.setOnClickListener(mOnClickButtonDialogInstructionsOK);

    mDialogInstructions = dialog;

    return mDialogInstructions;
}
项目:HoebApp    文件:PreferencesActivity.java   
@Click(R.id.addAccount)
public void addAccount() {
    dialog = new AccountDialog(this, null);

    dialog.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss(final DialogInterface paramDialogInterface) {
            final Account account = dialog.getAccount();
            if (account != null) {
                accounts.add(account);
            }
            updateAccounts();
        }
    });
    dialog.show();
}
项目:UIWidget    文件:UIActionSheetView.java   
/**
 * 设置关闭dialog 监听
 *
 * @param listener
 * @return
 */
public UIActionSheetView setOnDismissListener(OnDismissListener listener) {
    dialog.setOnDismissListener(listener);
    if (lLayoutItem != null) {
        lLayoutItem.removeAllViews();
    }
    if (lLayoutItem != null)
        lLayoutItem.removeAllViews();
    return this;
}
项目:PresenterLite    文件:StandaloneDisplayActivity.java   
private void updatePresentation() {
    MediaRouter.RouteInfo route = mediaRouter
            .getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO);
    Display presentationDisplay = route != null ? route
            .getPresentationDisplay() : null;
    if (displayPresentation != null
            && displayPresentation.getDisplay() != presentationDisplay) {
        displayPresentation.dismiss();
        displayPresentation = null;
    }
    if (displayPresentation == null && presentationDisplay != null) {
        displayPresentation = new DisplayPresentation(this, presentationDisplay);
        displayPresentation.setOnDismissListener(
                new OnDismissListener() {

                    @Override
                    public void onDismiss(DialogInterface dialog) {
                        if (dialog == displayPresentation) {
                            displayPresentation = null;
                        }
                    }
                }
        );
        displayPresentation.show();
        displayPresentation.go(displayLayout.getCurrentSlidePos(), displayLayout.getCurrentSlidePhase());
    }
}
项目:GuideHelper    文件:GuideHelper.java   
/**
 * @param autoPlay 是否自动播放提示
 * @return
 */
@TargetApi(Build.VERSION_CODES.KITKAT)
public GuideHelper show(boolean autoPlay) {
    this.autoPlay = autoPlay;
    //关闭dialog,移除handler消息
    dismiss();
    handler.removeCallbacksAndMessages(null);

    //创建dialog
    layout = new InnerChildRelativeLayout(activity);
    baseDialog = new Dialog(activity, android.R.style.Theme_DeviceDefault_Light_DialogWhenLarge_NoActionBar);
    baseDialog.getWindow().setBackgroundDrawable(new ColorDrawable(0x66000000));

    //设置沉浸式状态栏
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        WindowManager.LayoutParams localLayoutParams = baseDialog.getWindow().getAttributes();
        localLayoutParams.flags |= WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
        localLayoutParams.flags |= WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
    }

    baseDialog.setContentView(layout);
    //设置dialog的窗口大小全屏
    baseDialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
    //dialog关闭的时候移除所有消息
    baseDialog.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss(DialogInterface dialog) {
            handler.removeCallbacksAndMessages(null);
            if (onDismissListener != null) {
                baseDialog.setOnDismissListener(onDismissListener);
            }
        }
    });
    //显示
    baseDialog.show();
    startSend();
    return this;
}
项目:faims-android    文件:ShowModuleActivity.java   
private void showMemoryLowDialog() {
    memoryLowDialog = new ErrorDialog(this, getString(R.string.memory_low_title), getString(R.string.memory_low_message));
    memoryLowDialog.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss(DialogInterface dialog) {
            ShowModuleActivity.this.finish();
        }
    });
    memoryLowDialog.show();
}
项目:umeng_community_android    文件:FindActivity.java   
/**
 * 显示推荐话题的Dialog</br>
 */
private void showRecommendTopic() {
    if (mRecommendTopicFragment == null) {
        mRecommendTopicFragment = RecommendTopicFragment.newRecommendTopicFragment();
        mRecommendTopicFragment.setSaveButtonInVisiable();
        mRecommendTopicFragment.setOnDismissListener(new OnDismissListener() {

            @Override
            public void onDismiss(DialogInterface dialog) {
                showFindPage();
            }
        });
    }
    showCommFragment(mRecommendTopicFragment);
}
项目:umeng_community_android    文件:GuideActivity.java   
/**
 * 显示话题引导页面</br>
 */
private void showTopicFragment() {
    RecommendTopicFragment topicRecommendDialog =RecommendTopicFragment.newRecommendTopicFragment();
    topicRecommendDialog.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss(DialogInterface dialog) {
            showRecommendUserFragment();
        }
    });
    addFragment(mContainer, topicRecommendDialog);
}
项目:AndroidGeek    文件:FindActivity.java   
/**
 * 显示推荐话题的Dialog</br>
 */
private void showRecommendTopic() {
    if (mRecommendTopicFragment == null) {
        mRecommendTopicFragment = RecommendTopicFragment.newRecommendTopicFragment();
        mRecommendTopicFragment.setSaveButtonInVisiable();
        mRecommendTopicFragment.setOnDismissListener(new OnDismissListener() {

            @Override
            public void onDismiss(DialogInterface dialog) {
                showFindPage();
            }
        });
    }
    showCommFragment(mRecommendTopicFragment);
}