use of android.content.Context in project android-oss by kickstarter.
the class DiscoveryToolbar method searchButtonClick.
@OnClick(R.id.search_button)
public void searchButtonClick(@NonNull final View view) {
final Context context = getContext();
context.startActivity(new Intent(context, SearchActivity.class));
}
use of android.content.Context in project android-oss by kickstarter.
the class DiscoveryToolbar method onFinishInflate.
@Override
protected void onFinishInflate() {
super.onFinishInflate();
if (isInEditMode()) {
return;
}
ButterKnife.bind(this);
((KSApplication) getContext().getApplicationContext()).component().inject(this);
activityFeedButton.setOnClickListener(v -> {
final Context context = getContext();
context.startActivity(new Intent(context, ActivityFeedActivity.class));
});
}
use of android.content.Context in project nmid-headline by miao1007.
the class LollipopUtils method getStatusBarHeight.
public static int getStatusBarHeight(Context context) {
Context appContext = context.getApplicationContext();
int result = 0;
int resourceId = appContext.getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
result = appContext.getResources().getDimensionPixelSize(resourceId);
}
Log.d("ScreenUtils", result + "");
return result;
}
use of android.content.Context in project k-9 by k9mail.
the class MessageListFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Context appContext = getActivity().getApplicationContext();
preferences = Preferences.getPreferences(appContext);
messagingController = MessagingController.getInstance(getActivity().getApplication());
previewLines = K9.messageListPreviewLines();
checkboxes = K9.messageListCheckboxes();
stars = K9.messageListStars();
if (K9.showContactPicture()) {
contactsPictureLoader = ContactPicture.getContactPictureLoader(getActivity());
}
restoreInstanceState(savedInstanceState);
decodeArguments();
createCacheBroadcastReceiver(appContext);
initialized = true;
}
use of android.content.Context in project k-9 by k9mail.
the class MessageListFragment method createCacheBroadcastReceiver.
private void createCacheBroadcastReceiver(Context appContext) {
localBroadcastManager = LocalBroadcastManager.getInstance(appContext);
cacheBroadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
adapter.notifyDataSetChanged();
}
};
cacheIntentFilter = new IntentFilter(EmailProviderCache.ACTION_CACHE_UPDATED);
}
Aggregations