слайд слайдлок - PullRequest
       22

слайд слайдлок

0 голосов
/ 17 августа 2010

Я пытаюсь добавить SlideLock в свое приложение для версии, которую я устанавливаю на SlideMe. Я получаю сообщение об ошибке в mainActivityInstance по какой-то причине, и я не знаю почему. Есть идеи, что не так? Благодарю.

public void onCreate (Bundle icicle) { super.onCreate (сосулька); setContentView (R.layout.home);

    com.slideme.slidelock.License myLicense = 
        new com.slideme.slidelock.License("My first license", 
                                          "4839206850342",
                                          mainActivityInstance);
    // There are other constructors available also. 
    // This one is just the most comfortable.

    try{
        /* 
        *  You can store the fetched data in a persistent storage and retrieve 
        *  it from there on the next application startup, just in case you 
        *  want to save the end-user's networking traffic and reduce startup 
        *  delays. We strongly recommend you to refresh the license from 
        *  time to time, just in case the end-user claims a refund, or any 
        *  other corner case scenario
        */
        myLicense.digest(myLicense.fetch());
    } catch(IOException ioe){
        // license couldn't initialize. Handle this
    }

    Rights someRights = myLicense.getFullRights();
    // Works even if you already reserved the SlideLock Key in the past.

    if(someRights != null){
        // you have granted rights.
    } else {
        // You don't have any rights for the feature in cause. Try
        // some features. (Currently not supporting multiple 'features')
    }

1 Ответ

0 голосов
/ 18 августа 2010

Я не вижу, чтобы вы где-нибудь объявляли переменную mainActivityInstance. Если вы используете этот код в методе Activity # onCreate (Bundle icicle), вы можете попробовать создать экземпляр SlideLock2, передав ссылку на экземпляр Activity напрямую:

        new com.slideme.slidelock.License("My first license", 
                                      "4839206850342",
                                      this);

Дайте мне знать, если у вас возникнут дальнейшие проблемы.

Спасибо, -SlideME SlideLock Team

...