Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step 3 in Usage, where does the "helper" come from? #6

Open
DaFrik opened this issue Jan 22, 2016 · 1 comment
Open

Step 3 in Usage, where does the "helper" come from? #6

DaFrik opened this issue Jan 22, 2016 · 1 comment

Comments

@DaFrik
Copy link

DaFrik commented Jan 22, 2016

Hi,

Thanks for creating this nice form validator. I am trying to use it in my project. But I got stuck in Step 3 in Usage.

DefaultEntity entity = helper.create(DefaultEntity.class);

Android Studio yelled at me for unable to resolve the "helper" variable. I am new to native android development. May I know if that helper is your own class or it's a system class? Which package should I import?

Thanks,
D

@DaFrik
Copy link
Author

DaFrik commented Jan 22, 2016

I dug around your code and after trial and error I found a way to fix it.

Maybe you can try change Step 3 's code to the following

    ActivityFormHelper helper = new ActivityFormHelper(DefaultForm.class, this);
    ValidationResult result = helper.validate();
    if (result.hasError()) {
        // Show error messages
        Toast.makeText(this, result.getAllSerializedErrors(), Toast.LENGTH_SHORT).show();
    } else {
        // This entity object has clean and converted data
        DefaultEntity entity = helper.create(DefaultEntity.class);
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant