Home
last modified time | relevance | path

Searched refs:activity (Results 1 – 25 of 92) sorted by relevance

1234

/development/samples/browseable/BasicManagedProfile/src/com.example.android.basicmanagedprofile/
DBasicManagedProfileFragment.java98 public void onAttach(Activity activity) { in onAttach() argument
99 super.onAttach(activity); in onAttach()
113 Activity activity = getActivity(); in isApplicationEnabled() local
114 PackageManager packageManager = activity.getPackageManager(); in isApplicationEnabled()
124 (DevicePolicyManager) activity.getSystemService(Activity.DEVICE_POLICY_SERVICE); in isApplicationEnabled()
126 BasicDeviceAdminReceiver.getComponentName(activity), packageName); in isApplicationEnabled()
204 Activity activity = getActivity(); in setAppEnabled() local
205 if (null == activity) { in setAppEnabled()
208 PackageManager packageManager = activity.getPackageManager(); in setAppEnabled()
210 (DevicePolicyManager) activity.getSystemService(Context.DEVICE_POLICY_SERVICE); in setAppEnabled()
[all …]
DSetupProfileFragment.java71 Activity activity = getActivity(); in provisionManagedProfile() local
72 if (null == activity) { in provisionManagedProfile()
77 activity.getApplicationContext().getPackageName()); in provisionManagedProfile()
78 if (intent.resolveActivity(activity.getPackageManager()) != null) { in provisionManagedProfile()
80 activity.finish(); in provisionManagedProfile()
82 Toast.makeText(activity, "Device provisioning is not enabled. Stopping.", in provisionManagedProfile()
/development/samples/IntentPlayground/src/com/example/android/intentplayground/
DTracking.java62 public synchronized void onResume(Activity activity) { in onResume() argument
63 logNameEventAndTask(activity, "onResume"); in onResume()
65 int id = activity.getTaskId(); in onResume()
67 task.activityResumed(activity); in onResume()
82 public synchronized void onDestroy(Activity activity) { in onDestroy() argument
83 logNameEventAndTask(activity, "onDestroy"); in onDestroy()
87 .filter(t -> t.containsActivity(activity)) in onDestroy()
92 task.activityDestroyed(activity); in onDestroy()
115 for (Activity activity : task.mActivities) { in checkForMovedActivities()
116 if (activity.getTaskId() != task.id) { in checkForMovedActivities()
[all …]
DFlagUtils.java179 public static boolean hasActivityFlag(Context context, ComponentName activity,
181 return getActivityFlags(context, activity).contains(flag);
191 public static EnumSet<ActivityFlag> getActivityFlags(Context context, ComponentName activity) {
195 .filter(i-> i.name.equals(activity.getClassName()))
262 public static List<String> getActivityFlags(ActivityInfo activity) {
263 int flags = activity.flags;
264 List<String> flagStrings = Arrays.stream(activity.getClass().getDeclaredFields())
268 return (flags & f.getInt(activity)) > 0;
279 if (activity.launchMode != 0) {
281 switch(activity.launchMode) {
[all …]
DInlineAdapter.java49 public InlineAdapter(List<Task> tasks, FragmentActivity activity) { in InlineAdapter() argument
50 this.mActivity = activity; in InlineAdapter()
112 for (Activity activity : task.mActivities) { in setTask()
118 activityName.setText(activity.getComponentName().getShortClassName()); in setTask()
120 Intent intent = activity.getIntent(); in setTask()
130 showDialogWithFlags(manager, activity.getComponentName().getShortClassName(), in setTask()
/development/samples/WiFiDirectDemo/src/com/example/android/wifidirect/
DWiFiDirectBroadcastReceiver.java36 private WiFiDirectActivity activity; field in WiFiDirectBroadcastReceiver
44 WiFiDirectActivity activity) { in WiFiDirectBroadcastReceiver() argument
48 this.activity = activity; in WiFiDirectBroadcastReceiver()
65 activity.setIsWifiP2pEnabled(true); in onReceive()
67 activity.setIsWifiP2pEnabled(false); in onReceive()
68 activity.resetData(); in onReceive()
78 manager.requestPeers(channel, (PeerListListener) activity.getFragmentManager() in onReceive()
96 DeviceDetailFragment fragment = (DeviceDetailFragment) activity in onReceive()
101 activity.resetData(); in onReceive()
104 DeviceListFragment fragment = (DeviceListFragment) activity.getFragmentManager() in onReceive()
/development/samples/browseable/DeviceOwner/src/com.example.android.deviceowner/
DDeviceOwnerFragment.java140 public void onAttach(Activity activity) { in onAttach() argument
141 super.onAttach(activity); in onAttach()
143 (DevicePolicyManager) activity.getSystemService(Activity.DEVICE_POLICY_SERVICE); in onAttach()
155 Activity activity = getActivity(); in onResume() local
156 if (activity != null) { in onResume()
157 retrieveCurrentSettings(activity); in onResume()
166 private void retrieveCurrentSettings(Activity activity) { in retrieveCurrentSettings() argument
169 getBooleanGlobalSetting(activity.getContentResolver(), Settings.Global.AUTO_TIME)); in retrieveCurrentSettings()
171 getBooleanGlobalSetting(activity.getContentResolver(), in retrieveCurrentSettings()
177 List<ResolveInfo> list = activity.getPackageManager() in retrieveCurrentSettings()
[all …]
/development/samples/ApiDemos/src/com/example/android/apis/app/
DLocalSampleInstrumentation.java33 public final Activity activity; field in LocalSampleInstrumentation.ActivityRunnable
35 activity = _activity; in ActivityRunnable()
58 SaveRestoreState activity = (SaveRestoreState)startActivitySync(intent); in onStart() local
62 "Initial text: " + activity.getSavedText()); in onStart()
65 runOnMainSync(new ActivityRunnable(activity) { in onStart()
67 ((SaveRestoreState)activity).setSavedText(""); in onStart()
85 "Final text: " + activity.getSavedText()); in onStart()
/development/samples/ApiDemos/tests/src/com/example/android/apis/app/
DForwardingTest.java87 Forwarding activity = startActivity(mStartIntent, null, null); in testSubLaunch() local
88 mButton = (Button) activity.findViewById(R.id.go); in testSubLaunch()
103 Forwarding activity = startActivity(mStartIntent, null, null); in testLifeCycleCreate() local
107 getInstrumentation().callActivityOnStart(activity); in testLifeCycleCreate()
108 getInstrumentation().callActivityOnResume(activity); in testLifeCycleCreate()
114 getInstrumentation().callActivityOnPause(activity); in testLifeCycleCreate()
119 getInstrumentation().callActivityOnStop(activity); in testLifeCycleCreate()
/development/samples/browseable/AppRestrictionEnforcer/src/com.example.android.apprestrictionenforcer/
DStatusFragment.java59 public void onAttach(Activity activity) { in onAttach() argument
60 super.onAttach(activity); in onAttach()
61 mListener = (StatusUpdatedListener) activity; in onAttach()
86 private void updateUi(Activity activity) { in updateUi() argument
87 PackageManager packageManager = activity.getPackageManager(); in updateUi()
100 (DevicePolicyManager) activity.getSystemService(Activity.DEVICE_POLICY_SERVICE); in updateUi()
103 EnforcerDeviceAdminReceiver.getComponentName(activity), in updateUi()
130 private void unhideApp(Activity activity) { in unhideApp() argument
132 (DevicePolicyManager) activity.getSystemService(Activity.DEVICE_POLICY_SERVICE); in unhideApp()
134 EnforcerDeviceAdminReceiver.getComponentName(activity), in unhideApp()
[all …]
DSetupProfileFragment.java74 Activity activity = getActivity(); in provisionManagedProfile() local
75 if (null == activity) { in provisionManagedProfile()
81 EnforcerDeviceAdminReceiver.getComponentName(activity)); in provisionManagedProfile()
85 activity.getApplicationContext().getPackageName()); in provisionManagedProfile()
86 … intent.putExtra(EXTRA_DEVICE_ADMIN, EnforcerDeviceAdminReceiver.getComponentName(activity)); in provisionManagedProfile()
88 if (intent.resolveActivity(activity.getPackageManager()) != null) { in provisionManagedProfile()
90 activity.finish(); in provisionManagedProfile()
92 Toast.makeText(activity, "Device provisioning is not enabled. Stopping.", in provisionManagedProfile()
DAppRestrictionEnforcerFragment.java240 private void loadRestrictions(Activity activity) { in loadRestrictions() argument
242 (RestrictionsManager) activity.getSystemService(Context.RESTRICTIONS_SERVICE); in loadRestrictions()
245 SharedPreferences prefs = activity.getSharedPreferences(PREFS_KEY, Context.MODE_PRIVATE); in loadRestrictions()
258 updateRank(activity, restriction.getChoiceValues(), in loadRestrictions()
261 updateApprovals(activity, restriction.getChoiceValues(), in loadRestrictions()
273 updateItems(activity, items); in loadRestrictions()
378 private void saveCanSayHello(Activity activity, boolean allow) { in saveCanSayHello() argument
380 saveRestrictions(activity); in saveCanSayHello()
382 editPreferences(activity).putBoolean(RESTRICTION_KEY_SAY_HELLO, allow).apply(); in saveCanSayHello()
391 private void saveMessage(Activity activity, String message) { in saveMessage() argument
[all …]
/development/samples/training/TabCompat/src/com/example/android/tabcompat/lib/
DTabHelper.java41 protected TabHelper(FragmentActivity activity) { in TabHelper() argument
42 mActivity = activity; in TabHelper()
51 public static TabHelper createInstance(FragmentActivity activity) { in createInstance() argument
53 return new TabHelperHoneycomb(activity); in createInstance()
55 return new TabHelperEclair(activity); in createInstance()
/development/samples/browseable/CardReader/src/com.example.android.cardreader/
DCardReaderFragment.java82 Activity activity = getActivity(); in enableReaderMode() local
83 NfcAdapter nfc = NfcAdapter.getDefaultAdapter(activity); in enableReaderMode()
85 nfc.enableReaderMode(activity, mLoyaltyCardReader, READER_FLAGS, null); in enableReaderMode()
91 Activity activity = getActivity(); in disableReaderMode() local
92 NfcAdapter nfc = NfcAdapter.getDefaultAdapter(activity); in disableReaderMode()
94 nfc.disableReaderMode(activity); in disableReaderMode()
/development/samples/VoicemailProviderDemo/src/com/example/android/voicemail/common/inject/
DInjector.java52 private Injector(Activity activity) { in Injector() argument
53 mActivity = activity; in Injector()
59 public static Injector get(Activity activity) { in get() argument
60 return new Injector(activity); in get()
/development/samples/WiFiDirectServiceDiscovery/src/com/example/android/wifidirect/discovery/
DWiFiDirectBroadcastReceiver.java38 private Activity activity; field in WiFiDirectBroadcastReceiver
46 Activity activity) { in WiFiDirectBroadcastReceiver() argument
50 this.activity = activity; in WiFiDirectBroadcastReceiver()
78 (ConnectionInfoListener) activity); in onReceive()
/development/samples/browseable/Camera2Video/src/com.example.android.camera2video/
DCamera2VideoFragment.java211 Activity activity = getActivity();
212 if (null != activity) {
213 activity.finish();
320 Activity activity = getActivity(); in onClick() local
321 if (null != activity) { in onClick()
322 new AlertDialog.Builder(activity) in onClick()
421 final Activity activity = getActivity(); in openCamera() local
422 if (null == activity || activity.isFinishing()) { in openCamera()
425 CameraManager manager = (CameraManager) activity.getSystemService(Context.CAMERA_SERVICE); in openCamera()
452 Toast.makeText(activity, "Cannot access the camera.", Toast.LENGTH_SHORT).show(); in openCamera()
[all …]
/development/samples/browseable/XYZTouristAttractions/Application/src/com.example.android.xyztouristattractions/ui/
DDetailActivity.java41 public static void launch(Activity activity, String attraction, View heroView) { in launch() argument
42 Intent intent = getLaunchIntent(activity, attraction); in launch()
45 activity, heroView, heroView.getTransitionName()); in launch()
46 ActivityCompat.startActivity(activity, intent, options.toBundle()); in launch()
48 activity.startActivity(intent); in launch()
/development/samples/browseable/BluetoothChat/src/com.example.android.bluetoothchat/
DBluetoothChatFragment.java98 FragmentActivity activity = getActivity(); in onCreate() local
99 Toast.makeText(activity, "Bluetooth is not available", Toast.LENGTH_LONG).show(); in onCreate()
100 activity.finish(); in onCreate()
247 FragmentActivity activity = getActivity(); in setStatus() local
248 if (null == activity) { in setStatus()
251 final ActionBar actionBar = activity.getActionBar(); in setStatus()
264 FragmentActivity activity = getActivity(); in setStatus() local
265 if (null == activity) { in setStatus()
268 final ActionBar actionBar = activity.getActionBar(); in setStatus()
281 FragmentActivity activity = getActivity();
[all …]
/development/samples/training/basic/FragmentBasics/src/com/example/fragments/
DHeadlinesFragment.java58 public void onAttach(Activity activity) { in onAttach() argument
59 super.onAttach(activity); in onAttach()
64 mCallback = (OnHeadlineSelectedListener) activity; in onAttach()
66 throw new ClassCastException(activity.toString() in onAttach()
/development/samples/browseable/Camera2Basic/src/com.example.android.camera2basic/
DCamera2BasicFragment.java209 Activity activity = getActivity();
210 if (null != activity) {
211 activity.finish();
357 final Activity activity = getActivity(); in showToast() local
358 if (activity != null) { in showToast()
359 activity.runOnUiThread(new Runnable() { in showToast()
362 Toast.makeText(activity, text, Toast.LENGTH_SHORT).show(); in showToast()
492 Activity activity = getActivity(); in setUpCameraOutputs() local
493 CameraManager manager = (CameraManager) activity.getSystemService(Context.CAMERA_SERVICE); in setUpCameraOutputs()
522 int displayRotation = activity.getWindowManager().getDefaultDisplay().getRotation(); in setUpCameraOutputs()
[all …]
/development/samples/browseable/ScreenCapture/src/com.example.android.screencapture/
DScreenCaptureFragment.java90 Activity activity = getActivity(); in onActivityCreated() local
92 activity.getWindowManager().getDefaultDisplay().getMetrics(metrics); in onActivityCreated()
95 activity.getSystemService(Context.MEDIA_PROJECTION_SERVICE); in onActivityCreated()
128 Activity activity = getActivity(); in onActivityResult() local
129 if (activity == null) { in onActivityResult()
164 Activity activity = getActivity(); in startScreenCapture() local
165 if (mSurface == null || activity == null) { in startScreenCapture()
/development/samples/browseable/DelayedConfirmation/
D_index.jd10activity. This activity displays a DelayedConfirmationView that starts when the user presses "Start
12 … selected or finishes. The activity on the wearable uses BoxInsetLayout to automatically apply
/development/samples/browseable/DirectBoot/src/com.example.android.directboot/
DSchedulerFragment.java91 Activity activity = getActivity(); in onViewCreated() local
92 AlarmStorage alarmStorage = new AlarmStorage(activity); in onViewCreated()
93 mAlarmAdapter = new AlarmAdapter(activity, alarmStorage.getAlarms()); in onViewCreated()
98 recyclerView.setLayoutManager(new LinearLayoutManager(activity)); in onViewCreated()
100 recyclerView.addItemDecoration(new AlarmAdapter.DividerItemDecoration(activity)); in onViewCreated()
101 mAlarmUtil = new AlarmUtil(activity); in onViewCreated()
/development/samples/browseable/MediaRouter/src/com.example.android.mediarouter/player/
DSampleMediaButtonReceiver.java35 public static void setActivity(MainActivity activity) { in setActivity() argument
36 mActivity = activity; in setActivity()

1234