Archived Forum Post

Index of archived forum posts

Question:

In Android, when do I call the MailMan UnlockComponent?

Oct 23 '15 at 11:32

I am creating my first Android project and it uses POP3 and IMAP. I know I need to define the ckMailMan as well as the ckImap and call the UnLockComponent for each. I am just not sure where.

I have a MainActivity that displays my opening screen. This screen will need information from various email accounts. I am assuming I define the ckMailMan and ckImap and unlock calls at the top of this activity and use it when I need it. But I have second activity which is called from the MainActivity that needs information from various email accounts as well.

Do I redefine the ckMailMan and ckImap with unlock calls for this activity as well or just the one time? If I am doing it the one time, I am assuming then that the variable for each must be global, somehow, correct?

Final question, a single MailMan or Imap for multiple email accounts or does each need there own?

This is the part that is confusing with Android, when to call what.

Thanks for any help.


Accepted Answer

Once an instance of a given Chilkat class is unlocked, all new instances of the same class are automatically unlocked. In other words, UnlockComponent doesn't just unlock the instance of the object making the call, but it unlocks a class-wide internal variable that applies to all future objects of the same class.