0

SlideMeに配置しているバージョンのSlideLockをアプリに追加しようとしています。何らかの理由でmainActivityInstanceでエラーが発生しましたが、その理由がわかりません。何が悪いのか考えてみませんか?ありがとう。

public void onCreate(Bundle icicle){super.onCreate(icicle); 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')
    }
4

1 に答える 1

0

mainActivityInstance変数を宣言しているところはどこにもありません。Activity#onCreate(Bundle icicle)メソッドでこのコードを使用している場合は、Activityインスタンス参照を直接渡すことでSlideLock2のインスタンス化を試みることができます。

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

さらに問題が発生した場合はお知らせください。

ありがとう、-SlideME SlideLock Team

于 2010-08-18T18:20:43.020 に答える