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

Error inflating class io.ghyeok.stickyswitch.widget.StickySwitch #34

Open
rrenanh opened this issue Sep 13, 2020 · 1 comment
Open

Error inflating class io.ghyeok.stickyswitch.widget.StickySwitch #34

rrenanh opened this issue Sep 13, 2020 · 1 comment

Comments

@rrenanh
Copy link

rrenanh commented Sep 13, 2020

I'm trying to use a alertdialog from a layout containing the switch.

I get the error:
android.view.InflateException: Binary XML file line #39 in com.example.authenticatorapp:layout/layout_movimentacao_dialog: Binary XML file line #39 in com.example.authenticatorapp:layout/layout_movimentacao_dialog: Error inflating class io.ghyeok.stickyswitch.widget.StickySwitch

Can anybody help please?

xml code:
<io.ghyeok.stickyswitch.widget.StickySwitch android:id="@+id/sticky_switch" android:layout_width="wrap_content" android:layout_height="wrap_content" app:ss_animationDuration="600" app:ss_animationType="line" app:ss_iconPadding="18dp" app:ss_iconSize="22dp" app:ss_selectedTextSize="14sp" app:ss_textSize="12sp" />

Activity code:
`private void openMovimentacaoDialog() {
LayoutInflater inflater = LayoutInflater.from(this);
View view = inflater.inflate(R.layout.layout_movimentacao_dialog, null);

    AlertDialog alertDialog = new AlertDialog.Builder(this)
            .setView(view)
            .create();

    alertDialog.show();
}`
@Celestius010
Copy link

Hi there !

You most likely need the Kotlin standard library. Had the same problem and fixed it with :

implementation "org.jetbrains.kotlin:kotlin-stdlib:1.4.10"

Should work for you as well !

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

2 participants