Code example for DialogFragment

Methods: onAttach

0
	private Activity activity;
	private Account account;
 
	@Override 
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		this.activity = activity;
	} 
 
	@Override 
	public Dialog onCreateDialog(Bundle args) {
		AlertDialog.Builder builder = new AlertDialog.Builder(activity);
		builder.setTitle(R.string.select_account);
		final Account[] accounts = AccountManager.get(activity)
				.getAccountsByType("com.google");
		final int size = accounts.length;
		String[] names = new String[size];
		for (int i = 0; i < size; i++) {
			names[i] = accounts[i].name;
		} 
		// TODO