Back to project page ColorWallpaper.
The source code is released under:
Licensed under the Expat License. Copyright (C) 2013 Peter Occil Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the...
If you think the Android project ColorWallpaper listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.upokecenter.android.ui; // ww w . j av a 2 s.c o m import android.content.Context; import android.content.Intent; import android.preference.Preference; import android.util.AttributeSet; public class IntentPreference extends Preference { public IntentPreference(Context context, AttributeSet attrs) { super(context, attrs); } @Override public boolean isEnabled(){ Intent intent=getIntent(); Context context=getContext(); if(intent!=null && context!=null){ if(context.getPackageManager().queryIntentActivities(intent, 0).size()<=0) // Disable if no activities can handle the given intent return false; } return super.isEnabled(); } }