Search in sources :

Example 91 with Context

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;
}
Also used : Context(android.content.Context) DecorCaptionView(com.android.internal.widget.DecorCaptionView)

Example 92 with Context

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);
    }
}
Also used : Context(android.content.Context) DLIntent(com.ryg.dynamicload.internal.DLIntent)

Example 93 with Context

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);
}
Also used : Context(android.content.Context) NotificationManager(android.app.NotificationManager) PendingIntent(android.app.PendingIntent) Notification(android.app.Notification)

Example 94 with Context

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();
        }
    }
}
Also used : Context(android.content.Context) AppWidgetHostView(android.appwidget.AppWidgetHostView) AppWidgetHost(android.appwidget.AppWidgetHost) AppWidgetProviderInfo(android.appwidget.AppWidgetProviderInfo)

Example 95 with Context

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);
}
Also used : Context(android.content.Context) BridgeWindowSession(com.android.layoutlib.bridge.android.BridgeWindowSession) BridgeWindow(com.android.layoutlib.bridge.android.BridgeWindow) Handler(android.os.Handler) AttachInfo(android.view.View.AttachInfo)

Aggregations

Context (android.content.Context)3233 Intent (android.content.Intent)676 View (android.view.View)400 Test (org.junit.Test)346 BroadcastReceiver (android.content.BroadcastReceiver)338 IntentFilter (android.content.IntentFilter)301 TextView (android.widget.TextView)258 Resources (android.content.res.Resources)226 PendingIntent (android.app.PendingIntent)188 PackageManager (android.content.pm.PackageManager)164 File (java.io.File)156 IOException (java.io.IOException)150 LayoutInflater (android.view.LayoutInflater)139 ImageView (android.widget.ImageView)135 Drawable (android.graphics.drawable.Drawable)128 Uri (android.net.Uri)115 RemoteException (android.os.RemoteException)102 ArrayList (java.util.ArrayList)102 NameNotFoundException (android.content.pm.PackageManager.NameNotFoundException)101 Bundle (android.os.Bundle)95