Skip to content

can't get applicationcontext. #1

@Klaus3d3

Description

@Klaus3d3

Hi,

it's not excactly an issue with the springboard but a problem.

I'm working on a watchface based on AposGreatFit with a Background Service and a springboard widget for Settings.
I want to use sharedpreferences to read and write Settings from widget and from the Service.
For this i need the applicationcontext.
Problem is the only working appcontext i can get within the widget is from mHost.getHostWindow.getcontext().getapplicationcontext.

this Returns a different appcontext than getapplicationcontext within my Service therefor the Settings get saved in different files.
The widgets context seem the implicate that the widget is not pasrt of my app but runs within the launcher app.

When i try the common solution for this with an application class wich Returns the applicationcontext i get npe when i call this from the widget. Calling this from the Service is ok.

do you know a solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions