當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。