problem is which activities set disabling of app in its onResume etc.

We can make more than one variable but it may be walk around solution.

2013/6/8, element31 <notifications@github.com>:
>> @@ -59,4 +139,17 @@ private void startService(String
>> notificationBehaviour, int notificationID, Stri
>>  		
>>  		context.startService(intent);
>>  	}
>> +	
>> +	/**
>> +	 * Checks if application is displayed on screen.
>> +	 *
>> +	 * @return true if application is not visible on screen
>> +	 */
>> +	private boolean isAppRunningInBackground() {
>> +		List<RunningTaskInfo> topTask = activityManager.getRunningTasks(1);
>> +		ComponentName topActivity = topTask.get(0).topActivity;
>> +		String currentActivityPackageName = topActivity.getPackageName();
>> +		
>> +		return
>> !currentActivityPackageName.equalsIgnoreCase(urbanGamePackageName);
>> +	}
>
> But in solution I linked the information, about being in the background or
> the foreground, is stored in a static field, which does not depend on
> instance of an object. Read about class variables:
> http://docs.oracle.com/javase/tutorial/java/javaOO/classvars.html
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/blstream/UrbanGame/pull/86/files#r4602597
>