private void updateEnableState() {
   final SharedPreferences prefs = getSharedPreferences();
   if (prefs == null || mDependencyKey == null || mDependencyValues == null) return;
   final Map<String, ?> all = prefs.getAll();
   final String valueString =
       ParseUtils.parseString(all.get(mDependencyKey), mDependencyValueDefault);
   setEnabled(ArrayUtils.contains(mDependencyValues, valueString));
 }
コード例 #2
0
 @Override
 public void onClick(final DialogInterface dialog, final int which) {
   final Bundle args = getArguments();
   if (args == null
       || !args.containsKey(EXTRA_ACCOUNT_ID)
       || !args.containsKey(EXTRA_LIST_ID)
       || !args.containsKey(EXTRA_USERS)) return;
   switch (which) {
     case DialogInterface.BUTTON_POSITIVE:
       {
         final String mText = ParseUtils.parseString(mEditText.getText());
         final AsyncTwitterWrapper twitter = mTwitterWrapper;
         if (mText == null || mText.length() <= 0 || twitter == null) return;
         twitter.addUserListMembersAsync(
             args.getLong(EXTRA_ACCOUNT_ID), args.getLong(EXTRA_LIST_ID));
         break;
       }
   }
 }