Slideme 滑锁

发布于 2024-09-15 08:11:35 字数 1539 浏览 2 评论 0原文

我正在尝试将 SlideLock 添加到我的应用程序中,以获取要放在 SlideMe 上的版本。由于某种原因,我在 mainActivityInstance 处收到错误,但我不知道为什么。任何想法有什么问题吗?谢谢。

公共无效onCreate(捆绑冰柱){ 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')
    }

I'm trying to add SlideLock to my app for a version that I am putting on SlideMe. I am getting an error at mainActivityInstance for some reason and I don't know why. Any ideas what is wrong? Thanks.

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')
    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

埖埖迣鎅 2024-09-22 08:11:35

我没有看到您在任何地方声明 mainActivityInstance 变量。如果您在 Activity#onCreate(Bundle icicle) 方法中使用此代码,您可以尝试通过直接传递 Activity 实例引用来实例化 SlideLock2:

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

如果您还有其他问题,请告诉我。

谢谢你,
-SlideME SlideLock 团队

I don't see you declaring the mainActivityInstance variable anywhere. If you are using this code in the Activity#onCreate(Bundle icicle) method, you can try to instantiate SlideLock2 by passing the Activity instance reference directly:

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

Let me know if you have further trouble.

Thank you,
-SlideME SlideLock Team

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文