question

lainz avatar image
lainz asked lainz commented

getAccount is null

account = CloverAccount.getAccount(this);

I made an exact copy of the PrintTaskTestActivity and put it on my own program, with resources and everything. The problem is that in the clover test it works, but on my program it won't list the printers. I'm using an emulated printer, and an emulator to test.

What is the problem?

Clover Android SDK
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

David Marginian avatar image
David Marginian Deactivated answered lainz commented
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

lainz avatar image lainz commented ·

Thanks, the problem was requesting for permission


if (ContextCompat.checkSelfPermission(
        this,
        Manifest.permission.GET_ACCOUNTS
    ) != PackageManager.PERMISSION_GRANTED
) {
    ActivityCompat.requestPermissions(
        this,
        arrayOf(Manifest.permission.GET_ACCOUNTS),
        VentasTabletActivity.PERMISSION_GET_ACCOUNTS
    )
}
0 Likes 0 ·

Welcome to the
Clover Developer Community