当前位置: 首页>>代码示例>>Java>>正文


Java AlertDialog.findViewById方法代码示例

本文整理汇总了Java中android.support.v7.app.AlertDialog.findViewById方法的典型用法代码示例。如果您正苦于以下问题:Java AlertDialog.findViewById方法的具体用法?Java AlertDialog.findViewById怎么用?Java AlertDialog.findViewById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v7.app.AlertDialog的用法示例。


在下文中一共展示了AlertDialog.findViewById方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findMatch

import android.support.v7.app.AlertDialog; //导入方法依赖的package包/类
public void findMatch() {
    SharedPreferences preferences = getSharedPreferences("PREFS", 0);
    String[] fileNameList = preferences.getString("fileNameList", "").split(" ");

    double maxRatio = 0;
    String bestFileName = null;
    for (String fileName : fileNameList) {
        double ratio = matchFeaturesFile(fileName);
        if (ratio > maxRatio) {
            maxRatio = ratio;
            bestFileName = fileName;
        }
    }

    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setTitle("Match found");
    builder.setMessage(String.format("%s: %s%%", bestFileName, (int) (maxRatio * 100)));
    builder.setPositiveButton("OK", null);
    AlertDialog dialog = builder.show();

    // Must call show() prior to fetching text view
    TextView messageView = (TextView)dialog.findViewById(android.R.id.message);
    messageView.setGravity(Gravity.CENTER);
}
 
开发者ID:jorenham,项目名称:fingerblox,代码行数:25,代码来源:ImageDisplayActivity.java

示例2: init

import android.support.v7.app.AlertDialog; //导入方法依赖的package包/类
@Override
protected void init(Bundle savedInstanceState) {
    super.init(savedInstanceState);

    final AlertDialog dialog = new AlertDialog.Builder(this)
            .setTitle(R.string.crash_dialog_title)
            .setView(R.layout.crash_report_dialog)
            .setPositiveButton(R.string.ok, this)
            .setNegativeButton(R.string.cancel, this)
            .create();

    dialog.setCanceledOnTouchOutside(false);
    dialog.setOnDismissListener(this);
    dialog.show();

    comment = (EditText) dialog.findViewById(android.R.id.input);
    if (savedInstanceState != null) {
        comment.setText(savedInstanceState.getString(STATE_COMMENT));
    }
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:21,代码来源:CrashReportActivity.java

示例3: onCreateDialog

import android.support.v7.app.AlertDialog; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final File file = (File) getArguments().getSerializable(EXTRA_FILEPATH);

    LayoutInflater inflater = LayoutInflater.from(getActivity());
    AlertDialog.Builder dialogBuilder = setUpDialog(file, inflater);
    AlertDialog dialog = dialogBuilder.show();
    dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);

    _newNameField = dialog.findViewById(R.id.new_name);
    return dialog;
}
 
开发者ID:gsantner,项目名称:markor,代码行数:13,代码来源:RenameDialog.java

示例4: showFileInfo

import android.support.v7.app.AlertDialog; //导入方法依赖的package包/类
/**
 * show dialog with file info
 * filePath, path, size, extension ...
 *
 * @param file - file to show info
 */
private void showFileInfo(File file) {
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setTitle(file.getName());
    builder.setView(R.layout.dialog_view_file);
    AlertDialog dialog = builder.create();
    dialog.show();
    TextView txtInfo = dialog.findViewById(R.id.txt_info);
    txtInfo.setText(file.getPath() + "\n" +
            file.length() + " byte");
    EditorView editorView = dialog.findViewById(R.id.editor_view);
    if (editorView != null && FileUtils.canEdit(file)) {
        editorView.setTextHighlighted(mFileManager.fileToString(file));
    }
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:21,代码来源:ProjectManagerActivity.java

示例5: showDialogAbout

import android.support.v7.app.AlertDialog; //导入方法依赖的package包/类
private void showDialogAbout() {
    final SpannableString m = new SpannableString(getString(R.string.dialog_about_text));
    Linkify.addLinks(m, Linkify.WEB_URLS);

    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setTitle(R.string.title_about);
    builder.setMessage(m);
    builder.setPositiveButton(R.string.dialog_ok, null);
    AlertDialog alertDialog = builder.show();

    TextView textView = alertDialog.findViewById(android.R.id.message);
    if (textView != null) {
        textView.setMovementMethod(LinkMovementMethod.getInstance());
    }
}
 
开发者ID:riteshakya037,项目名称:Wallpapers-Android-Clean-Architecture,代码行数:16,代码来源:OnBoardingActivity.java


注:本文中的android.support.v7.app.AlertDialog.findViewById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。