use of android.content.Context in project platform_frameworks_base by android.
the class DecorView method inflateDecorCaptionView.
private DecorCaptionView inflateDecorCaptionView(LayoutInflater inflater) {
final Context context = getContext();
// We make a copy of the inflater, so it has the right context associated with it.
inflater = inflater.from(context);
final DecorCaptionView view = (DecorCaptionView) inflater.inflate(R.layout.decor_caption, null);
setDecorCaptionShade(context, view);
return view;
}
use of android.content.Context in project dynamic-load-apk by singwhatiwanna.
the class TestFragment method onClick.
@Override
public void onClick(View v) {
if (v == button1) {
Context context = getActivity();
DLIntent dlIntent = new DLIntent(mPluginPackageName, MainActivity.class);
DLPluginManager.getInstance(context).startPluginActivity(context, dlIntent);
}
}
use of android.content.Context in project simplefacebook by androidquery.
the class PostActivity method notify.
private void notify(String ticker, String title, String message, Intent intent) {
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
int icon = R.drawable.launcher;
long when = System.currentTimeMillis();
Notification notification = new Notification(icon, ticker, when);
Context context = getApplicationContext();
CharSequence contentText = message;
int id = getNotifyId();
PendingIntent contentIntent = PendingIntent.getActivity(this, id, intent, 0);
notification.setLatestEventInfo(context, title, contentText, contentIntent);
mNotificationManager.cancelAll();
AQUtility.debug("notify id", id);
mNotificationManager.notify(id, notification);
}
use of android.content.Context in project platform_frameworks_base by android.
the class AppWidgetHostActivity method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
mAppWidgetManager = AppWidgetManager.getInstance(this);
setContentView(R.layout.appwidget_host);
mHost = new AppWidgetHost(this, HOST_ID) {
protected AppWidgetHostView onCreateView(Context context, int appWidgetId, AppWidgetProviderInfo appWidget) {
return new MyAppWidgetView(appWidgetId);
}
};
findViewById(R.id.add_appwidget).setOnClickListener(mOnClickListener);
mAppWidgetContainer = (AppWidgetContainerView) findViewById(R.id.appwidget_container);
if (false) {
if (false) {
mHost.deleteHost();
} else {
AppWidgetHost.deleteAllHosts();
}
}
}
use of android.content.Context in project platform_frameworks_base by android.
the class AttachInfo_Accessor method setAttachInfo.
public static void setAttachInfo(View view) {
Context context = view.getContext();
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
ViewRootImpl root = new ViewRootImpl(context, display);
AttachInfo info = new AttachInfo(new BridgeWindowSession(), new BridgeWindow(), display, root, new Handler(), null);
info.mHasWindowFocus = true;
info.mWindowVisibility = View.VISIBLE;
// this is so that we can display selections.
info.mInTouchMode = false;
info.mHardwareAccelerated = false;
view.dispatchAttachedToWindow(info, 0);
}
Aggregations