Giter Club home page Giter Club logo

Comments (5)

satyan avatar satyan commented on July 21, 2024

Your Application class could extend from SugarApp.

You could also use the code from SugarApp and include it in your application. This however, may need few more changes in other parts of the code, since we're taking the context from SugarApp.

I'd suggest extending it as an easier solution. Let me know if that's fine.

from sugar.

dereksantos avatar dereksantos commented on July 21, 2024

May I suggest that a future version of Sugar use an interface instead of inheritance?

For example, instead of:

MyApplication extends SugarApp {}

it could implement an interface

MyApplication extends Application implements ISugarApp {
   public void initializeSugar() {} //as an example
}

This would prevent issues when you need to extend other types of android application classes(perhaps from another 3rd party library), and helps sugar stand on it's own.

Of course, I would still leave SugarApp(inheritance version) as an option for convenience, since many applications will not have this problem.

from sugar.

QuickBrownFoxy avatar QuickBrownFoxy commented on July 21, 2024

@dereksantos do you have any merge request for this? I can get my way around java but implementing this proving hard for me

from sugar.

whoshuu avatar whoshuu commented on July 21, 2024

This has been implemented in bcb9bad.

from sugar.

PGMacDesign avatar PGMacDesign commented on July 21, 2024

My apologies for revisiting this, but after your changes were made, what do I need to implement within my MyApplication class for this to run? As with the user above, I am currently running a MyApplication extends Application setup for Singleton context purposes. Do I implement something after the extends? Or is there an entirely different solution?
Thanks!
-Sil

from sugar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.