0

In my application rather than following the regular hierarchy of the ActiveAndorid,

I'm explicitly calling with the .initialize() method by passing the getApplicationContext.

However, the TableInfo returned doesnt have any Tables from the model class that I'm creating.

I tried debug their code and it seems an issue with the classloader they are using. My code is:

ActiveAndroid.initialize(getApplicationContext());
TestModel model=new TestModel();
model.value="hello";
model.save();
rock_win
  • 755
  • 1
  • 5
  • 14
  • ActiveAndroid.initialize() doesn’t return anything (void). What exactly is your problem? Did you read and follow the documentation? https://github.com/pardom/ActiveAndroid/wiki/Getting-started – Loxley Feb 03 '13 at 18:07
  • I'm not expecting it to return anything, but the method internally scans the code and creates the table structure as per the annotations, which it is not. – rock_win Feb 16 '13 at 18:47
  • Are you using proguard? – Joe May 16 '13 at 19:28
  • no i'm not using proguard – rock_win May 24 '13 at 15:12

1 Answers1

0

You should not use getApplicationContext. It might not return the context of your application. The naming of getApplicationContext is misleading.

More info here: getApplication() vs. getApplicationContext()

Community
  • 1
  • 1
Julian Pieles
  • 3,880
  • 2
  • 23
  • 33