On 03/28/2014 02:59 PM, Daniel Passos wrote:
>
> In src/org/jboss/aerogear/cookbook/datamanager/HowToUseSQLStorage.java:
>
> > +public class HowToUseSQLStorage extends ListActivity {
> > +
> > +    private static final int DIALOG_ADD = 1;
> > +    private SQLStore<Car> store;
> > +    private IncrementalIdGenerator idGenerator;
> > +
> > +    @Override
> > +    protected void onCreate(Bundle savedInstanceState) {
> > +        super.onCreate(savedInstanceState);
> > +        setContentView(R.layout.car_list);
> > +
> > +        StoreConfig storeConfig = new StoreConfig();
> > +        storeConfig.setContext(getApplicationContext());
> > +        storeConfig.setType(StoreTypes.SQL);
> > +        storeConfig.setKlass(Car.class);
> > +        idGenerator = new IncrementalIdGenerator(readLastSQLStoreIdFromSharedPreference());
>
> I can't access SharedPreference before the onCreate. Right?
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/aerogear/aerogear-android-cookbook/pull/12/files#r11080836>.
>
Yeah that's right.  Silly application contexts.