List of usage examples for android.content Context getApplicationContext
public abstract Context getApplicationContext();
From source file:com.liferay.alerts.callback.AddVoteCallback.java
public AddVoteCallback(Context context, Alert alert, RadioGroup group) { _context = context.getApplicationContext(); _alert = alert; _group = group; }
From source file:com.liferay.alerts.callback.SignInAsyncTaskCallback.java
public SignInAsyncTaskCallback(Context context, String server, String login, String password) { _context = context.getApplicationContext(); _server = server;/*from w ww. j av a2s .c o m*/ _login = login; _password = password; }
From source file:de.vanita5.twittnuker.util.ThemeUtils.java
public static int getThemeColor(Context context, int themeResourceId) { final Context appContext = context.getApplicationContext(); final Resources res = appContext.getResources(); final TypedArray a = appContext.obtainStyledAttributes(null, new int[] { android.R.attr.colorActivatedHighlight }, 0, themeResourceId); try {/*from w w w .jav a 2 s . c om*/ return a.getColor(0, res.getColor(R.color.material_light_blue)); } finally { a.recycle(); } }
From source file:com.gsoc.ijosa.liquidgalaxycontroller.PW.UrlShortenerClient.java
private UrlShortenerClient(Context context) { mContext = context.getApplicationContext(); mRequestQueue = Volley.newRequestQueue(mContext); mEndpointUrl = Utils.PROD_ENDPOINT; }
From source file:com.orange.ocara.model.SitesLoaderImpl.java
/** * Constructor./*from w ww .j a v a2s . c o m*/ * * @param context */ @Inject public SitesLoaderImpl(Context context) { this.context = context.getApplicationContext(); }
From source file:com.iespuig.attendancemanager.ClassblockFetchr.java
public ClassblockFetchr(Context context) { this.context = context.getApplicationContext(); }
From source file:com.fanfou.app.opensource.http.SimpleClient.java
public SimpleClient(final Context context) { this.mAppContext = context.getApplicationContext(); }
From source file:com.amazonaws.mobileconnectors.pinpoint.internal.core.system.AndroidAppDetails.java
public AndroidAppDetails(Context context, String appId) { this.applicationContext = context.getApplicationContext(); try {//www . j a v a 2 s .c o m PackageManager packageManager = this.applicationContext.getPackageManager(); PackageInfo packageInfo = packageManager.getPackageInfo(this.applicationContext.getPackageName(), 0); ApplicationInfo appInfo = packageManager.getApplicationInfo(packageInfo.packageName, 0); appTitle = (String) packageManager.getApplicationLabel(appInfo); packageName = packageInfo.packageName; versionCode = String.valueOf(packageInfo.versionCode); versionName = packageInfo.versionName; this.appId = appId; } catch (NameNotFoundException e) { log.warn("Unable to get details for package " + this.applicationContext.getPackageName()); appTitle = "Unknown"; packageName = "Unknown"; versionCode = "Unknown"; versionName = "Unknown"; } }
From source file:com.liferay.alerts.callback.VoteCallback.java
public VoteCallback(Context context, long alertId, int questionId) { _context = context.getApplicationContext(); _alertId = alertId;/* w ww . j av a 2 s . c o m*/ _questionId = questionId; }
From source file:com.github.michalbednarski.intentslab.providerlab.proxy.ProxyProviderDatabase.java
private ProxyProviderDatabase(Context context) { super(context.getApplicationContext(), "ProxyProviderDatabase", null, DB_VERSION); }