Home
last modified time | relevance | path

Searched refs:context (Results 1 – 25 of 580) sorted by relevance

12345678910>>...24

/developers/samples/android/wearable/wear/Notifications/Wearable/src/main/java/com/example/android/support/wearable/notifications/
DNotificationPresets.java53 private static Notification.Builder buildBasicNotification(Context context) { in buildBasicNotification() argument
54 return new Notification.Builder(context) in buildBasicNotification()
55 .setContentTitle(context.getString(R.string.example_content_title)) in buildBasicNotification()
56 .setContentText(context.getString(R.string.example_content_text)) in buildBasicNotification()
58 .setContentIntent(PendingIntent.getActivity(context, 0, in buildBasicNotification()
59 new Intent(context, MainActivity.class), 0)) in buildBasicNotification()
69 public Notification buildNotification(Context context) { in buildNotification() argument
70 PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, in buildNotification()
71 new Intent(context, MainActivity.class), 0); in buildNotification()
73 Notification page2 = buildBasicNotification(context) in buildNotification()
[all …]
/developers/build/prebuilts/gradle/Notifications/Wearable/src/main/java/com/example/android/support/wearable/notifications/
DNotificationPresets.java53 private static Notification.Builder buildBasicNotification(Context context) { in buildBasicNotification() argument
54 return new Notification.Builder(context) in buildBasicNotification()
55 .setContentTitle(context.getString(R.string.example_content_title)) in buildBasicNotification()
56 .setContentText(context.getString(R.string.example_content_text)) in buildBasicNotification()
58 .setContentIntent(PendingIntent.getActivity(context, 0, in buildBasicNotification()
59 new Intent(context, MainActivity.class), 0)) in buildBasicNotification()
69 public Notification buildNotification(Context context) { in buildNotification() argument
70 PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, in buildNotification()
71 new Intent(context, MainActivity.class), 0); in buildNotification()
73 Notification page2 = buildBasicNotification(context) in buildNotification()
[all …]
/developers/samples/android/wearable/wear/Notifications/Application/src/main/java/com/example/android/support/wearable/notifications/
DNotificationPresets.java70 private static NotificationCompat.Builder applyBasicOptions(Context context, in applyBasicOptions() argument
77 context, R.string.example_notification_deleted)); in applyBasicOptions()
78 options.actionsPreset.apply(context, builder, wearableOptions); in applyBasicOptions()
82 context.getResources(), R.drawable.example_large_icon)); in applyBasicOptions()
88 builder.setContentIntent(NotificationUtil.getExamplePendingIntent(context, in applyBasicOptions()
104 public Notification[] buildNotifications(Context context, BuildOptions options) { in buildNotifications() argument
105 NotificationCompat.Builder builder = new NotificationCompat.Builder(context); in buildNotifications()
108 applyBasicOptions(context, builder, wearableOptions, options); in buildNotifications()
121 public Notification[] buildNotifications(Context context, BuildOptions options) { in buildNotifications() argument
158 NotificationCompat.Builder builder = new NotificationCompat.Builder(context) in buildNotifications()
[all …]
DActionsPresets.java45 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument
56 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument
59 context.getString(R.string.example_action), in apply()
60 NotificationUtil.getExamplePendingIntent(context, in apply()
72 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument
75 context.getString(R.string.example_action_long_title), in apply()
76 NotificationUtil.getExamplePendingIntent(context, in apply()
88 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument
91 .setLabel(context.getString(R.string.example_reply_label)) in apply()
95 context.getString(R.string.example_reply_action), in apply()
[all …]
/developers/build/prebuilts/gradle/Notifications/Application/src/main/java/com/example/android/support/wearable/notifications/
DNotificationPresets.java70 private static NotificationCompat.Builder applyBasicOptions(Context context, in applyBasicOptions() argument
77 context, R.string.example_notification_deleted)); in applyBasicOptions()
78 options.actionsPreset.apply(context, builder, wearableOptions); in applyBasicOptions()
82 context.getResources(), R.drawable.example_large_icon)); in applyBasicOptions()
88 builder.setContentIntent(NotificationUtil.getExamplePendingIntent(context, in applyBasicOptions()
104 public Notification[] buildNotifications(Context context, BuildOptions options) { in buildNotifications() argument
105 NotificationCompat.Builder builder = new NotificationCompat.Builder(context); in buildNotifications()
108 applyBasicOptions(context, builder, wearableOptions, options); in buildNotifications()
121 public Notification[] buildNotifications(Context context, BuildOptions options) { in buildNotifications() argument
158 NotificationCompat.Builder builder = new NotificationCompat.Builder(context) in buildNotifications()
[all …]
DActionsPresets.java45 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument
56 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument
59 context.getString(R.string.example_action), in apply()
60 NotificationUtil.getExamplePendingIntent(context, in apply()
72 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument
75 context.getString(R.string.example_action_long_title), in apply()
76 NotificationUtil.getExamplePendingIntent(context, in apply()
88 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument
91 .setLabel(context.getString(R.string.example_reply_label)) in apply()
95 context.getString(R.string.example_reply_action), in apply()
[all …]
/developers/samples/android/content/WidgetData/Application/src/main/java/com/example/android/widgetdata/
DWeatherWidgetProvider.java88 public void onEnabled(Context context) { in onEnabled() argument
93 final ContentResolver r = context.getContentResolver(); in onEnabled()
95 final AppWidgetManager mgr = AppWidgetManager.getInstance(context); in onEnabled()
96 final ComponentName cn = new ComponentName(context, WeatherWidgetProvider.class); in onEnabled()
110 final Context context = ctx; in onReceive() local
115 final ContentResolver r = context.getContentResolver(); in onReceive()
132 final AppWidgetManager mgr = AppWidgetManager.getInstance(context); in onReceive()
133 … final ComponentName cn = new ComponentName(context, WeatherWidgetProvider.class); in onReceive()
152 private RemoteViews buildLayout(Context context, int appWidgetId, boolean largeLayout) { in buildLayout() argument
157 final Intent intent = new Intent(context, WeatherWidgetService.class); in buildLayout()
[all …]
/developers/samples/android/admin/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/
DDeviceOwnerReceiver.java36 public void onProfileProvisioningComplete(Context context, Intent intent) { in onProfileProvisioningComplete() argument
39 (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE); in onProfileProvisioningComplete()
40 ComponentName componentName = getComponentName(context); in onProfileProvisioningComplete()
41 manager.setProfileName(componentName, context.getString(R.string.profile_name)); in onProfileProvisioningComplete()
43 Intent launch = new Intent(context, MainActivity.class); in onProfileProvisioningComplete()
45 context.startActivity(launch); in onProfileProvisioningComplete()
52 public static ComponentName getComponentName(Context context) { in getComponentName() argument
53 return new ComponentName(context.getApplicationContext(), DeviceOwnerReceiver.class); in getComponentName()
/developers/build/prebuilts/gradle/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/
DDeviceOwnerReceiver.java36 public void onProfileProvisioningComplete(Context context, Intent intent) { in onProfileProvisioningComplete() argument
39 (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE); in onProfileProvisioningComplete()
40 ComponentName componentName = getComponentName(context); in onProfileProvisioningComplete()
41 manager.setProfileName(componentName, context.getString(R.string.profile_name)); in onProfileProvisioningComplete()
43 Intent launch = new Intent(context, MainActivity.class); in onProfileProvisioningComplete()
45 context.startActivity(launch); in onProfileProvisioningComplete()
52 public static ComponentName getComponentName(Context context) { in getComponentName() argument
53 return new ComponentName(context.getApplicationContext(), DeviceOwnerReceiver.class); in getComponentName()
/developers/build/prebuilts/gradle/MessagingService/Application/src/main/java/com/example/android/messagingservice/
DMessageLogger.java39 public static void logMessage(Context context, String message) { in logMessage() argument
40 SharedPreferences prefs = getPrefs(context); in logMessage()
47 public static SharedPreferences getPrefs(Context context) { in getPrefs() argument
48 return context.getSharedPreferences(PREF_MESSAGE, Context.MODE_PRIVATE); in getPrefs()
51 public static String getAllMessages(Context context) { in getAllMessages() argument
52 return getPrefs(context).getString(LOG_KEY, ""); in getAllMessages()
55 public static void clear(Context context) { in clear() argument
56 getPrefs(context).edit().remove(LOG_KEY).apply(); in clear()
/developers/samples/android/notification/MessagingService/Application/src/main/java/com/example/android/messagingservice/
DMessageLogger.java39 public static void logMessage(Context context, String message) { in logMessage() argument
40 SharedPreferences prefs = getPrefs(context); in logMessage()
47 public static SharedPreferences getPrefs(Context context) { in getPrefs() argument
48 return context.getSharedPreferences(PREF_MESSAGE, Context.MODE_PRIVATE); in getPrefs()
51 public static String getAllMessages(Context context) { in getAllMessages() argument
52 return getPrefs(context).getString(LOG_KEY, ""); in getAllMessages()
55 public static void clear(Context context) { in clear() argument
56 getPrefs(context).edit().remove(LOG_KEY).apply(); in clear()
/developers/build/prebuilts/gradle/AsymmetricFingerprintDialog/Application/src/main/java/com/example/android/asymmetricfingerprintdialog/
DFingerprintModule.java51 public FingerprintModule(Context context) { in FingerprintModule() argument
52 mContext = context; in FingerprintModule()
61 public FingerprintManager providesFingerprintManager(Context context) { in providesFingerprintManager() argument
62 return context.getSystemService(FingerprintManager.class); in providesFingerprintManager()
66 public KeyguardManager providesKeyguardManager(Context context) { in providesKeyguardManager() argument
67 return context.getSystemService(KeyguardManager.class); in providesKeyguardManager()
98 public InputMethodManager providesInputMethodManager(Context context) { in providesInputMethodManager() argument
99 return (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); in providesInputMethodManager()
103 public SharedPreferences providesSharedPreferences(Context context) { in providesSharedPreferences() argument
104 return PreferenceManager.getDefaultSharedPreferences(context); in providesSharedPreferences()
/developers/samples/android/security/AsymmetricFingerprintDialog/Application/src/main/java/com/example/android/asymmetricfingerprintdialog/
DFingerprintModule.java51 public FingerprintModule(Context context) { in FingerprintModule() argument
52 mContext = context; in FingerprintModule()
61 public FingerprintManager providesFingerprintManager(Context context) { in providesFingerprintManager() argument
62 return context.getSystemService(FingerprintManager.class); in providesFingerprintManager()
66 public KeyguardManager providesKeyguardManager(Context context) { in providesKeyguardManager() argument
67 return context.getSystemService(KeyguardManager.class); in providesKeyguardManager()
98 public InputMethodManager providesInputMethodManager(Context context) { in providesInputMethodManager() argument
99 return (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); in providesInputMethodManager()
103 public SharedPreferences providesSharedPreferences(Context context) { in providesSharedPreferences() argument
104 return PreferenceManager.getDefaultSharedPreferences(context); in providesSharedPreferences()
/developers/samples/android/ui/activityscenetransition/ActivitySceneTransitionBasic/Application/src/main/java/com/example/android/activityscenetransitionbasic/
DSquareFrameLayout.java28 public SquareFrameLayout(Context context) { in SquareFrameLayout() argument
29 super(context); in SquareFrameLayout()
32 public SquareFrameLayout(Context context, AttributeSet attrs) { in SquareFrameLayout() argument
33 super(context, attrs); in SquareFrameLayout()
36 public SquareFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) { in SquareFrameLayout() argument
37 super(context, attrs, defStyleAttr); in SquareFrameLayout()
40 public SquareFrameLayout(Context context, AttributeSet attrs, in SquareFrameLayout() argument
42 super(context, attrs, defStyleAttr, defStyleRes); in SquareFrameLayout()
/developers/build/prebuilts/gradle/ActivitySceneTransitionBasic/Application/src/main/java/com/example/android/activityscenetransitionbasic/
DSquareFrameLayout.java28 public SquareFrameLayout(Context context) { in SquareFrameLayout() argument
29 super(context); in SquareFrameLayout()
32 public SquareFrameLayout(Context context, AttributeSet attrs) { in SquareFrameLayout() argument
33 super(context, attrs); in SquareFrameLayout()
36 public SquareFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) { in SquareFrameLayout() argument
37 super(context, attrs, defStyleAttr); in SquareFrameLayout()
40 public SquareFrameLayout(Context context, AttributeSet attrs, in SquareFrameLayout() argument
42 super(context, attrs, defStyleAttr, defStyleRes); in SquareFrameLayout()
/developers/build/prebuilts/androidtv/leanback/app/src/main/java/com/example/android/leanback/
DUtils.java44 public static Point getDisplaySize(Context context) { in getDisplaySize() argument
45 WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); in getDisplaySize()
61 public static final void showErrorDialog(Context context, String errorString) { in showErrorDialog() argument
62 new AlertDialog.Builder(context).setTitle(R.string.error) in showErrorDialog()
80 public static void showToast(Context context, String msg) { in showToast() argument
81 Toast.makeText(context, msg, Toast.LENGTH_LONG).show(); in showToast()
90 public static void showToast(Context context, int resourceId) { in showToast() argument
91 Toast.makeText(context, context.getString(resourceId), Toast.LENGTH_LONG).show(); in showToast()
DBootupActivity.java33 public void onReceive(Context context, Intent intent) { in onReceive() argument
36 scheduleRecommendationUpdate(context); in onReceive()
40 private void scheduleRecommendationUpdate(Context context) { in scheduleRecommendationUpdate() argument
43 AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); in scheduleRecommendationUpdate()
44 Intent recommendationIntent = new Intent(context, UpdateRecommendationsService.class); in scheduleRecommendationUpdate()
45 PendingIntent alarmIntent = PendingIntent.getService(context, 0, recommendationIntent, 0); in scheduleRecommendationUpdate()
/developers/build/prebuilts/androidtv/leanback/app/src/main/java/com/example/android/tvleanback/
DUtils.java39 public static Point getDisplaySize(Context context) { in getDisplaySize() argument
40 WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); in getDisplaySize()
52 public static void showToast(Context context, String msg) { in showToast() argument
53 Toast.makeText(context, msg, Toast.LENGTH_LONG).show(); in showToast()
59 public static void showToast(Context context, int resourceId) { in showToast() argument
60 Toast.makeText(context, context.getString(resourceId), Toast.LENGTH_LONG).show(); in showToast()
/developers/samples/android/ui/views/FloatingActionButton/FloatingActionButtonBasic/Application/src/main/java/com/example/android/floatingactionbuttonbasic/
DFloatingActionButton.java63 public FloatingActionButton(Context context) { in FloatingActionButton() argument
64 this(context, null, 0, 0); in FloatingActionButton()
67 public FloatingActionButton(Context context, AttributeSet attrs) { in FloatingActionButton() argument
68 this(context, attrs, 0, 0); in FloatingActionButton()
71 public FloatingActionButton(Context context, AttributeSet attrs, int defStyleAttr) { in FloatingActionButton() argument
72 this(context, attrs, defStyleAttr, 0); in FloatingActionButton()
75 public FloatingActionButton(Context context, AttributeSet attrs, int defStyleAttr, in FloatingActionButton() argument
77 super(context, attrs, defStyleAttr); in FloatingActionButton()
/developers/build/prebuilts/gradle/FloatingActionButtonBasic/Application/src/main/java/com/example/android/floatingactionbuttonbasic/
DFloatingActionButton.java63 public FloatingActionButton(Context context) { in FloatingActionButton() argument
64 this(context, null, 0, 0); in FloatingActionButton()
67 public FloatingActionButton(Context context, AttributeSet attrs) { in FloatingActionButton() argument
68 this(context, attrs, 0, 0); in FloatingActionButton()
71 public FloatingActionButton(Context context, AttributeSet attrs, int defStyleAttr) { in FloatingActionButton() argument
72 this(context, attrs, defStyleAttr, 0); in FloatingActionButton()
75 public FloatingActionButton(Context context, AttributeSet attrs, int defStyleAttr, in FloatingActionButton() argument
77 super(context, attrs, defStyleAttr); in FloatingActionButton()
/developers/samples/android/wearable/wear/JumpingJack/Wearable/src/main/java/com/example/android/wearable/jumpingjack/
DUtils.java36 public final static void vibrate(Context context, int duration) { in vibrate() argument
40 Vibrator v = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); in vibrate()
48 public static void saveCounterToPreference(Context context, int value) { in saveCounterToPreference() argument
49 SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context); in saveCounterToPreference()
62 public static int getCounterFromPreference(Context context) { in getCounterFromPreference() argument
63 SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context); in getCounterFromPreference()
/developers/build/prebuilts/gradle/JumpingJack/Wearable/src/main/java/com/example/android/wearable/jumpingjack/
DUtils.java36 public final static void vibrate(Context context, int duration) { in vibrate() argument
40 Vibrator v = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); in vibrate()
48 public static void saveCounterToPreference(Context context, int value) { in saveCounterToPreference() argument
49 SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context); in saveCounterToPreference()
62 public static int getCounterFromPreference(Context context) { in getCounterFromPreference() argument
63 SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context); in getCounterFromPreference()
/developers/build/prebuilts/androidtv/leanback/app/src/main/java/com/example/android/tvleanback/recommendation/
DBootupActivity.java35 public void onReceive(Context context, Intent intent) { in onReceive() argument
38 scheduleRecommendationUpdate(context); in onReceive()
42 private void scheduleRecommendationUpdate(Context context) { in scheduleRecommendationUpdate() argument
45 AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); in scheduleRecommendationUpdate()
46 Intent recommendationIntent = new Intent(context, UpdateRecommendationsService.class); in scheduleRecommendationUpdate()
47 PendingIntent alarmIntent = PendingIntent.getService(context, 0, recommendationIntent, 0); in scheduleRecommendationUpdate()
/developers/samples/android/media/Camera2Video/Application/src/main/java/com/example/android/camera2video/
DAutoFitTextureView.java31 public AutoFitTextureView(Context context) { in AutoFitTextureView() argument
32 this(context, null); in AutoFitTextureView()
35 public AutoFitTextureView(Context context, AttributeSet attrs) { in AutoFitTextureView() argument
36 this(context, attrs, 0); in AutoFitTextureView()
39 public AutoFitTextureView(Context context, AttributeSet attrs, int defStyle) { in AutoFitTextureView() argument
40 super(context, attrs, defStyle); in AutoFitTextureView()
/developers/samples/android/media/Camera2Basic/Application/src/main/java/com/example/android/camera2basic/
DAutoFitTextureView.java31 public AutoFitTextureView(Context context) { in AutoFitTextureView() argument
32 this(context, null); in AutoFitTextureView()
35 public AutoFitTextureView(Context context, AttributeSet attrs) { in AutoFitTextureView() argument
36 this(context, attrs, 0); in AutoFitTextureView()
39 public AutoFitTextureView(Context context, AttributeSet attrs, int defStyle) { in AutoFitTextureView() argument
40 super(context, attrs, defStyle); in AutoFitTextureView()

12345678910>>...24