本文整理汇总了Java中com.csipsimple.utils.CustomDistribution.getCustomDistributionWizard方法的典型用法代码示例。如果您正苦于以下问题:Java CustomDistribution.getCustomDistributionWizard方法的具体用法?Java CustomDistribution.getCustomDistributionWizard怎么用?Java CustomDistribution.getCustomDistributionWizard使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.csipsimple.utils.CustomDistribution
的用法示例。
在下文中一共展示了CustomDistribution.getCustomDistributionWizard方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateOptionsMenu
import com.csipsimple.utils.CustomDistribution; //导入方法依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
int actionRoom = getResources().getBoolean(R.bool.menu_in_bar) ? MenuItem.SHOW_AS_ACTION_IF_ROOM : MenuItem.SHOW_AS_ACTION_NEVER;
WizardInfo distribWizard = CustomDistribution.getCustomDistributionWizard();
if (distribWizard != null) {
menu.add(Menu.NONE, DISTRIB_ACCOUNT_MENU, Menu.NONE, "My " + distribWizard.label)
.setIcon(distribWizard.icon)
.setShowAsAction(actionRoom);
}
if (CustomDistribution.distributionWantsOtherAccounts()) {
int accountRoom = actionRoom;
if(Compatibility.isCompatible(13)) {
accountRoom |= MenuItem.SHOW_AS_ACTION_WITH_TEXT;
}
menu.add(Menu.NONE, ACCOUNTS_MENU, Menu.NONE,
(distribWizard == null) ? R.string.accounts : R.string.other_accounts)
.setIcon(R.drawable.ic_menu_account_list)
.setAlphabeticShortcut('a')
.setShowAsAction( accountRoom );
}
menu.add(Menu.NONE, PARAMS_MENU, Menu.NONE, R.string.prefs)
.setIcon(android.R.drawable.ic_menu_preferences)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
menu.add(Menu.NONE, HELP_MENU, Menu.NONE, R.string.help)
.setIcon(android.R.drawable.ic_menu_help)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
menu.add(Menu.NONE, CLOSE_MENU, Menu.NONE, R.string.menu_disconnect)
.setIcon(R.drawable.ic_lock_power_off)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
return super.onCreateOptionsMenu(menu);
}
示例2: onOptionsItemSelected
import com.csipsimple.utils.CustomDistribution; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case ACCOUNTS_MENU:
startActivity(new Intent(this, AccountsEditList.class));
return true;
case PARAMS_MENU:
startActivityForResult(new Intent(SipManager.ACTION_UI_PREFS_GLOBAL), CHANGE_PREFS);
return true;
case CLOSE_MENU:
Log.d(THIS_FILE, "CLOSE");
boolean currentlyActiveForIncoming = prefProviderWrapper.isValidConnectionForIncoming();
boolean futureActiveForIncoming = (prefProviderWrapper.getAllIncomingNetworks().size() > 0);
if (currentlyActiveForIncoming || futureActiveForIncoming) {
// Alert user that we will disable for all incoming calls as
// he want to quit
new AlertDialog.Builder(this)
.setTitle(R.string.warning)
.setMessage(
getString(currentlyActiveForIncoming ? R.string.disconnect_and_incoming_explaination
: R.string.disconnect_and_future_incoming_explaination))
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
prefProviderWrapper.setPreferenceBooleanValue(PreferencesWrapper.HAS_BEEN_QUIT, true);
disconnect(true);
}
})
.setNegativeButton(R.string.cancel, null)
.show();
} else {
disconnect(true);
}
return true;
case HELP_MENU:
// Create the fragment and show it as a dialog.
DialogFragment newFragment = Help.newInstance();
newFragment.show(getSupportFragmentManager(), "dialog");
return true;
case DISTRIB_ACCOUNT_MENU:
WizardInfo distribWizard = CustomDistribution.getCustomDistributionWizard();
Cursor c = getContentResolver().query(SipProfile.ACCOUNT_URI, new String[] {
SipProfile.FIELD_ID
}, SipProfile.FIELD_WIZARD + "=?", new String[] {
distribWizard.id
}, null);
Intent it = new Intent(this, BasePrefsWizard.class);
it.putExtra(SipProfile.FIELD_WIZARD, distribWizard.id);
Long accountId = null;
if (c != null && c.getCount() > 0) {
try {
c.moveToFirst();
accountId = c.getLong(c.getColumnIndex(SipProfile.FIELD_ID));
} catch (Exception e) {
Log.e(THIS_FILE, "Error while getting wizard", e);
} finally {
c.close();
}
}
if (accountId != null) {
it.putExtra(SipProfile.FIELD_ID, accountId);
}
startActivityForResult(it, REQUEST_EDIT_DISTRIBUTION_ACCOUNT);
return true;
default:
break;
}
return super.onOptionsItemSelected(item);
}