List of usage examples for android.content Context getApplicationContext
public abstract Context getApplicationContext();
From source file:com.tenforwardconsulting.cordova.bgloc.AbstractLocationProvider.java
protected AbstractLocationProvider(LocationDAO dao, Config config, Context context) { this.dao = dao; this.config = config; this.context = context.getApplicationContext(); }
From source file:com.orange.ocara.model.RuleSetLoaderImpl.java
/** * Constructor./*w w w . j a va2s . co m*/ * * @param context */ @Inject public RuleSetLoaderImpl(Context context) { this.context = context.getApplicationContext(); }
From source file:com.android.xbrowser.FetchUrlMimeType.java
public FetchUrlMimeType(Context context, DownloadManager.Request request, String uri, String cookies, String userAgent) {/*from w w w .j a v a 2 s.c o m*/ mContext = context.getApplicationContext(); mRequest = request; mUri = uri; mCookies = cookies; mUserAgent = userAgent; }
From source file:mobisocial.metrics.UsageMetrics.java
/** * Creates a UserMetrics for tracking wholly anonymous statistics. *//* ww w .j a va2 s . c o m*/ public UsageMetrics(Context context) { mContext = context.getApplicationContext(); mUser = null; init(); }
From source file:org.droidparts.http.RESTClient.java
public RESTClient(Context ctx, String userAgent) { this.ctx = ctx.getApplicationContext(); this.userAgent = userAgent; if (Build.VERSION.SDK_INT >= 14) { setHttpResponseCacheEnabled(true); }// w w w.j a v a 2 s .c om }
From source file:com.iespuig.attendancemanager.StudentFetchr.java
public StudentFetchr(Context context) { this.context = context.getApplicationContext(); }
From source file:edu.stanford.mobisocial.dungbeetle.feed.presence.MusicPresence.java
@Override public void onPresenceUpdated(final Context context, final Uri feedUri, boolean present) { if (mShareMusic) { if (getFeedsWithPresence().size() == 0) { context.getApplicationContext().unregisterReceiver(mReceiver); Toast.makeText(context, "No longer sharing music", Toast.LENGTH_SHORT).show(); mShareMusic = false;//from ww w . ja v a 2 s .c om } } else { if (getFeedsWithPresence().size() > 0) { IntentFilter iF = new IntentFilter(); iF.addAction("com.android.music.metachanged"); context.getApplicationContext().registerReceiver(mReceiver, iF); Toast.makeText(context, "Now sharing music", Toast.LENGTH_SHORT).show(); mShareMusic = true; } } }
From source file:com.jobs.lib_v1.imageloader.core.download.BaseImageDownloader.java
public BaseImageDownloader(Context context, int connectTimeout, int readTimeout) { this.context = context.getApplicationContext(); }
From source file:com.ibm.demo.IoTStarter.utils.MessageConductor.java
private MessageConductor(Context context) { this.context = context; app = (IoTStarterApplication) context.getApplicationContext(); }
From source file:mobisocial.metrics.UsageMetrics.java
/** * Creates a UserMetrics with stats linked against the given Musubi user. */// w w w.j a v a 2s . c o m public UsageMetrics(Context context, User user) { mContext = context.getApplicationContext(); mUser = user; mLevel = ReportingLevel.NON_ANONYMOUS; init(); }