public static WifiSkipDialog newInstance(int messageRes) { final Bundle args = new Bundle(); args.putInt("messageRes", messageRes); final WifiSkipDialog dialog = new WifiSkipDialog(); dialog.setArguments(args); return dialog; }
@Override public void onNavigateNext() { if (mWifiConnected) { finish(RESULT_OK); } else { // Warn of possible data charges if there is a network connection, or lack of updates // if there is none. final int message = isNetworkConnected() ? R.string.wifi_skipped_message : R.string.wifi_and_mobile_skipped_message; WifiSkipDialog.newInstance(message).show(getFragmentManager(), "dialog"); } }