Service getApplication - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Service getApplication method.

This code example shows how to use the following methods: getApplication
	public static final WeatherSliderApplication locate(Activity activity) {
		return ((WeatherSliderApplication) activity.getApplication());
	} 
 
	public static final WeatherSliderApplication locate(Service service) {
		return ((WeatherSliderApplication) service.getApplication());
	} 
 
	@Override 
	public void onCreate() { 
		ACRA.init(this);
		super.onCreate(); 
 
		if (BuildUtils.isRunningEmmulator()) { 
			ErrorReporter.getInstance().disable(); 
		} 
 
		// SETUP three available notifications 
		WEATHERS.put(R.string.weather_notification_service_1, null);
		WEATHERS.put(R.string.weather_notification_service_2, null);
Full Snippet Info
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: getApplication
            } 
        } 
 
        if (context instanceof Service) {
            Service service = (Service) context;
            Application app = service.getApplication();
            if (app instanceof LifecycleCallbacksSupportApplication) {
                return (LifecycleCallbacksSupportApplication) app;
            } 
        } 
 
        Context appContext = context.getApplicationContext();
        if (appContext instanceof LifecycleCallbacksSupportApplication) {
            return (LifecycleCallbacksSupportApplication) appContext;
        } 
 
        if (context instanceof ContextWrapper) {
            Context base = ((ContextWrapper) context).getBaseContext();
 
            if (base != null) {
Full Snippet Info
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: getApplication
		appHolder = (AppHolder) activity.getApplication();
		init(activity);
	} 
 
	public YouRoomCommandProxy(Service service) {
		appHolder = (AppHolder) service.getApplication();
		init(service);
	} 
 
	private void init(Context context) {
		cacheDb = appHolder.getCacheDb();
		youRoomCommand = new YouRoomCommand(new YouRoomUtil(appHolder).getOauthTokenFromLocal());
		youRoomUtil = new YouRoomUtil(context);
	} 
 
	public Bitmap getRoomImage(String roomId, boolean[] errFlg) {
		Bitmap roomImage = null;
		byte[] image = null;
 
		try { 
Full Snippet Info
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Service getApplication Questions & Answers:

getApplication Method Overview
Return the application that owns this service.
See Code Examples for other Android Service Methods: