import android.os.Handler;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.provider.BaseColumns;
import android.provider.ContactsContract;
import android.provider.ContactsContract.AggregationExceptions;
import android.provider.ContactsContract.CommonDataKinds;
} else {
mAdapter.setSections(mSections, SHOW_SEPARATORS);
}
-
-// else {
-// Toast.makeText(this, R.string.invalidContactMessage, Toast.LENGTH_SHORT).show();
-// Log.e(TAG, "invalid contact uri: " + mOriginalUri);
-// finish();
-// }
}
@Override
}
case MENU_ITEM_SPLIT_AGGREGATE: {
- showSplitAggregateDialog();
+ if (mRawContactIds.size() == 2) {
+ splitContact(mRawContactIds.get(1));
+ } else {
+ showSplitAggregateDialog();
+ }
return true;
}
* The user picks a contact to be split into its own aggregate or clicks Cancel.
*/
private void showSplitAggregateDialog() {
-
// Wrap this dialog in a specific theme so that list items have correct text color.
final ContextThemeWrapper dialogContext =
new ContextThemeWrapper(this, android.R.style.Theme_Light);
// The split operation may have removed the original aggregate contact, so we need
// to requery everything
- Toast.makeText(this, R.string.contactsSplitMessage, Toast.LENGTH_SHORT).show();
+ Toast.makeText(this, R.string.contactsSplitMessage, Toast.LENGTH_LONG).show();
startEntityQuery();
}
c.close();
}
- Toast.makeText(this, R.string.contactsJoinedMessage, Toast.LENGTH_SHORT).show();
- mAdapter.notifyDataSetChanged();
+ Toast.makeText(this, R.string.contactsJoinedMessage, Toast.LENGTH_LONG).show();
+ startEntityQuery();
}
/**