Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Alloy Collection. Receiving a "Failed adding to JNI local ref table (has 512 entries)" error. Android

$
0
0

I've base my code in the Todo List sample for Alloy, which I've installed in my Android tablet and it works perfect. In my app, the problem is that the first time I add a model to the Collection, it works. But after that when I add a model it rise this error

Failed adding to JNI local ref table (has 512 entries)

This is my model test.js

exports.definition = {
    config: {
 
        "columns": {
            "title": "String"
        },
        "adapter": {
            "type": "sql",
            "collection_name": "test"
        }
    },
    extendModel: function(Model) {
        _.extend(Model.prototype, {
            // extended functions and properties go here
        });
 
        return Model;
    },
    extendCollection: function(Collection) {
        _.extend(Collection.prototype, {
            // extended functions and properties go here
        });
 
        return Collection;
    }
};
and this is what I do from my controller
var testCollection = Alloy.createCollection('test');
 
    // Create a new model for the collection
    var testModel = Alloy.createModel('test', {
        title : 'myTitle'
    });
 
    // add new model to the collection
    testCollection.add(testModel);
 
    // save the model to persistent storage
    testModel.save();
 
    // reload the tasks
    testCollection.fetch();

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>