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


Java DialogFragment.show方法代码示例

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


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

示例1: alertDialog

import android.app.DialogFragment; //导入方法依赖的package包/类
/**
 * For working with pre-Android M security permissions
 * @param gpsEnabled If the cacheManifest and system allow gps
 * @param networkLocationEnabled If the cacheManifest and system allow network location access
 * @param cellularEnabled If the cacheManifest and system allow cellular data access
 */
private void alertDialog(boolean gpsEnabled, boolean networkLocationEnabled, boolean cellularEnabled){

    if(!gpsEnabled || !networkLocationEnabled){
        sendCallback(PluginResult.Status.ERROR,
                JSONHelper.errorJSON(PROVIDER_PRIMARY, ErrorMessages.LOCATION_SERVICES_UNAVAILABLE()));

        final DialogFragment gpsFragment = new GPSAlertDialogFragment();
        gpsFragment.show(_cordovaActivity.getFragmentManager(), "GPSAlert");
    }

    if(!cellularEnabled){
        sendCallback(PluginResult.Status.ERROR,
                JSONHelper.errorJSON(PROVIDER_PRIMARY, ErrorMessages.CELL_DATA_NOT_AVAILABLE()));

        final DialogFragment networkUnavailableFragment = new NetworkUnavailableDialogFragment();
        networkUnavailableFragment.show(_cordovaActivity.getFragmentManager(), "NetworkUnavailableAlert");
    }
}
 
开发者ID:SUTFutureCoder,项目名称:localcloud_fe,代码行数:25,代码来源:AdvancedGeolocation.java

示例2: showChangelog

import android.app.DialogFragment; //导入方法依赖的package包/类
public static void showChangelog(FragmentManager fm) 
{
       FragmentTransaction ft = fm.beginTransaction();
       Fragment prev = fm.findFragmentByTag(TAG);
       if (prev != null) 
	{
           ft.remove(prev);
       }
       try 
	{
           DialogFragment dialog = DialogFragmentChangelog.newInstance();
           dialog.show(ft, TAG);
       } 
	catch (IllegalArgumentException | IllegalStateException ignored)
	{ }
   }
 
开发者ID:MSay2,项目名称:Mire,代码行数:17,代码来源:DialogFragmentChangelog.java

示例3: onOptionsItemSelected

import android.app.DialogFragment; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    if(R.id.add_photo == id) {
        Intent intent = new Intent();
        intent.setType("image/*");
        intent.setAction(Intent.ACTION_GET_CONTENT);
        startActivityForResult(Intent.createChooser(intent, getResources().getString(R.string.add_photo)), PICK_IMAGE);
    } else if(R.id.clear == id) {
        List<Drawable> drawables = imageViewPagerAdapter.drawables;
        drawables.clear();
        addDefaultImages(drawables);
        imageViewPagerAdapter.notifyDataSetChanged();
    } else if(R.id.info == id) {
        DialogFragment infoDialogFragment = new InfoDialogFragment();
        infoDialogFragment.show(getFragmentManager(), "info");
    }
    return super.onOptionsItemSelected(item);
}
 
开发者ID:martinwithaar,项目名称:PinchToZoom,代码行数:20,代码来源:MainActivity.java

示例4: onDateSet

import android.app.DialogFragment; //导入方法依赖的package包/类
@Override
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
    String tag = getTag();

    MainActivity activity = (MainActivity) getActivity();

    // threeten's LocalDate months are zero-indexed.
    month++;

    switch (tag) {
        case "start_date_picker":
            activity.set_start_date(year, month, dayOfMonth);
            DialogFragment end_date_fragment = new DatePickerFragment();
            end_date_fragment.show(getFragmentManager(), "end_date_picker");
            break;
        case "end_date_picker":
            activity.set_end_date(year, month, dayOfMonth);
            activity.generate_potd_list();
            break;
    }
}
 
开发者ID:borfast,项目名称:arrispwgen-android,代码行数:22,代码来源:DatePickerFragment.java

示例5: showDialog

import android.app.DialogFragment; //导入方法依赖的package包/类
void showDialog(String text) {
    // DialogFragment.show() will take care of adding the fragment
    // in a transaction.  We also want to remove any currently showing
    // dialog, so make our own transaction and take care of that here.
    FragmentTransaction ft = getFragmentManager().beginTransaction();

    DialogFragment newFragment = MyDialogFragment.newInstance(text);

    // Show the dialog.
    newFragment.show(ft, "dialog");
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:12,代码来源:MainActivity.java

示例6: onEventMainThread

import android.app.DialogFragment; //导入方法依赖的package包/类
public void onEventMainThread(ThrowableFailureEvent event) {
    if (ErrorDialogManager.isInExecutionScope(this.executionScope, event)) {
        ErrorDialogManager.checkLogException(event);
        FragmentManager fm = getFragmentManager();
        fm.executePendingTransactions();
        DialogFragment existingFragment = (DialogFragment) fm.findFragmentByTag(ErrorDialogManager.TAG_ERROR_DIALOG);
        if (existingFragment != null) {
            existingFragment.dismiss();
        }
        DialogFragment errorFragment = (DialogFragment) ErrorDialogManager.factory.prepareErrorFragment(event, this.finishAfterDialog, this.argumentsForErrorDialog);
        if (errorFragment != null) {
            errorFragment.show(fm, ErrorDialogManager.TAG_ERROR_DIALOG);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:16,代码来源:ErrorDialogManager.java

示例7: onOptionsItemSelected

import android.app.DialogFragment; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    switch (id) {
        case R.id.action_selet_dates:
            DialogFragment start_date_fragment = new DatePickerFragment();
            start_date_fragment.show(getFragmentManager(), "start_date_picker");
            return true;

        case R.id.action_set_seed:
            DialogFragment set_seed_fragment = new SetSeedDialogFragment();

            Bundle args = new Bundle();
            args.putString("seed", seed);
            set_seed_fragment.setArguments(args);

            set_seed_fragment.show(getFragmentManager(), "set_seed_dialog");
            return true;

        default:
            return super.onOptionsItemSelected(item);
    }
}
 
开发者ID:borfast,项目名称:arrispwgen-android,代码行数:28,代码来源:MainActivity.java

示例8: onPreferenceTreeClick

import android.app.DialogFragment; //导入方法依赖的package包/类
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
    if (preference.equals(findPreference(Constants.PREF_IMAGES_CACHE))) {
        File cacheDir = getActivity().getCacheDir();
        File picassoCacheDir = new File(cacheDir, "picasso-cache");
        int messageId = AppUtils.deleteDir(picassoCacheDir) ? R.string.clear_cache_message_ok : R.string.clear_cache_message_fail;
        DialogFragment dialogFragment = new SettingsAlertDialog().newInstance(messageId);
        dialogFragment.show(getActivity().getFragmentManager(), "clearCache");
        updateSummary(Constants.PREF_IMAGES_CACHE, false);
    }
    return super.onPreferenceTreeClick(preferenceScreen, preference);
}
 
开发者ID:ansarisufiyan777,项目名称:Show_Chat,代码行数:13,代码来源:SettingsActivity.java

示例9: showDatePickerDialog

import android.app.DialogFragment; //导入方法依赖的package包/类
public void showDatePickerDialog(View v) {
    DialogFragment newFragment = new DatePickerFragment();
    newFragment.show(getFragmentManager(), "datePicker");
}
 
开发者ID:smartlockpicking,项目名称:hackmelock-android,代码行数:5,代码来源:ShareActivity.java

示例10: taskEnded

import android.app.DialogFragment; //导入方法依赖的package包/类
@Override
public void taskEnded(final JSONArray resultList)
{
    
    overlay.setVisibility(View.GONE);
    overlay.setClickable(false);
    codeField.setClickable(true);
    syncButton.setOnClickListener(listener);
    
    if (resultList != null && resultList.length() > 0 && !syncTask.hasError())
        for (int i = 0; i < resultList.length(); i++)
        {
            
            codeField.clearFocus();
            syncButton.requestFocus();
            
            JSONObject resultListItem;
            try
            {
                resultListItem = resultList.getJSONObject(i);
                
                final String title = resultListItem.optString("msg_title");
                final String text = resultListItem.optString("msg_text");
                final boolean success = resultListItem.optBoolean("success");
                
                if (text.length() > 0)
                {
                    String popBackStackIncluding = null;
                    if (success)
                    {
                        popBackStackIncluding = "sync";
                        ((RMBTMainActivity) getActivity()).setHistoryDirty(true);
                        ((RMBTMainActivity) getActivity()).setSettings(null, null);
                        ((RMBTMainActivity) getActivity()).checkSettings(true, null);
                    }
                    
                    final DialogFragment newFragment = RMBTAlertDialogFragment.newInstance(title, text,
                            popBackStackIncluding);
                    
                    newFragment.show(getActivity().getFragmentManager(), "sync_msg");
                }
                
            }
            catch (final JSONException e)
            {
                e.printStackTrace();
            }
            
        }
}
 
开发者ID:rtr-nettest,项目名称:open-rmbt,代码行数:51,代码来源:RMBTSyncEnterCodeFragment.java

示例11: show

import android.app.DialogFragment; //导入方法依赖的package包/类
public static void show(final FragmentManager fm, final Transaction tx) {
    final DialogFragment newFragment = instance(tx);
    newFragment.show(fm, FRAGMENT_TAG);
}
 
开发者ID:guodroid,项目名称:okwallet,代码行数:5,代码来源:RaiseFeeDialogFragment.java

示例12: showSearchDialog

import android.app.DialogFragment; //导入方法依赖的package包/类
/**
 * Creates a new instance of the search dialog and displays it.
 */
public void showSearchDialog() {
    DialogFragment dialog = UserSearchDialog.newInstance();
    dialog.show(getFragmentManager(), "UserSearchDialog");
}
 
开发者ID:CMPUT301F17T09,项目名称:GoalsAndHabits,代码行数:8,代码来源:FollowActivity.java

示例13: showCommentDialog

import android.app.DialogFragment; //导入方法依赖的package包/类
/**
 * Displays the comment dialog
 */
public void showCommentDialog() {
    DialogFragment dialog = AddCommentDialog.newInstance();
    dialog.show(getFragmentManager(), "AddCommentDialog");
}
 
开发者ID:CMPUT301F17T09,项目名称:GoalsAndHabits,代码行数:8,代码来源:FollowedEventActivity.java

示例14: showRequestDialog

import android.app.DialogFragment; //导入方法依赖的package包/类
/**
 * Displays the dialog asking if the user wishes to send a follow request to the selected profile
 * @param p Profile to be requested to follow
 */
public void showRequestDialog(Profile p) {
    DialogFragment dialog = SendRequestDialog.newInstance(p.getUsername());
    dialog.show(getFragmentManager(), "SendRequestDialog");
}
 
开发者ID:CMPUT301F17T09,项目名称:GoalsAndHabits,代码行数:9,代码来源:SearchResultsActivity.java

示例15: showAcceptDialog

import android.app.DialogFragment; //导入方法依赖的package包/类
/**
 * Displays the dialog to accept or decline a follower request
 * @param follower Potential follower profile
 */
public void showAcceptDialog(Profile follower) {
    DialogFragment dialog = AcceptFollowerDialog.newInstance(follower);
    dialog.show(getFragmentManager(), "AcceptFollowerDialog");
}
 
开发者ID:CMPUT301F17T09,项目名称:GoalsAndHabits,代码行数:9,代码来源:FollowerRequestsActivity.java


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