Home
last modified time | relevance | path

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

12345678

/developers/samples/android/admin/BasicManagedProfile/Application/src/main/java/com/example/android/basicmanagedprofile/
DBasicManagedProfileFragment.java114 Activity activity = getActivity(); in isApplicationEnabled() local
115 PackageManager packageManager = activity.getPackageManager(); in isApplicationEnabled()
132 (DevicePolicyManager) activity.getSystemService(Activity.DEVICE_POLICY_SERVICE); in isApplicationEnabled()
134 BasicDeviceAdminReceiver.getComponentName(activity), packageName); in isApplicationEnabled()
212 Activity activity = getActivity(); in setAppEnabled() local
213 if (null == activity) { in setAppEnabled()
216 PackageManager packageManager = activity.getPackageManager(); in setAppEnabled()
218 (DevicePolicyManager) activity.getSystemService(Context.DEVICE_POLICY_SERVICE); in setAppEnabled()
236 BasicDeviceAdminReceiver.getComponentName(activity), packageName); in setAppEnabled()
246 BasicDeviceAdminReceiver.getComponentName(activity), packageName, !enabled); in setAppEnabled()
[all …]
DSetupProfileFragment.java71 Activity activity = getActivity(); in provisionManagedProfile() local
72 if (null == activity) { in provisionManagedProfile()
81 activity.getApplicationContext().getPackageName()); in provisionManagedProfile()
83 final ComponentName component = new ComponentName(activity, in provisionManagedProfile()
89 if (intent.resolveActivity(activity.getPackageManager()) != null) { in provisionManagedProfile()
91 activity.finish(); in provisionManagedProfile()
93 Toast.makeText(activity, "Device provisioning is not enabled. Stopping.", in provisionManagedProfile()
/developers/build/prebuilts/gradle/BasicManagedProfile/Application/src/main/java/com/example/android/basicmanagedprofile/
DBasicManagedProfileFragment.java114 Activity activity = getActivity(); in isApplicationEnabled() local
115 PackageManager packageManager = activity.getPackageManager(); in isApplicationEnabled()
132 (DevicePolicyManager) activity.getSystemService(Activity.DEVICE_POLICY_SERVICE); in isApplicationEnabled()
134 BasicDeviceAdminReceiver.getComponentName(activity), packageName); in isApplicationEnabled()
212 Activity activity = getActivity(); in setAppEnabled() local
213 if (null == activity) { in setAppEnabled()
216 PackageManager packageManager = activity.getPackageManager(); in setAppEnabled()
218 (DevicePolicyManager) activity.getSystemService(Context.DEVICE_POLICY_SERVICE); in setAppEnabled()
236 BasicDeviceAdminReceiver.getComponentName(activity), packageName); in setAppEnabled()
246 BasicDeviceAdminReceiver.getComponentName(activity), packageName, !enabled); in setAppEnabled()
[all …]
DSetupProfileFragment.java71 Activity activity = getActivity(); in provisionManagedProfile() local
72 if (null == activity) { in provisionManagedProfile()
81 activity.getApplicationContext().getPackageName()); in provisionManagedProfile()
83 final ComponentName component = new ComponentName(activity, in provisionManagedProfile()
89 if (intent.resolveActivity(activity.getPackageManager()) != null) { in provisionManagedProfile()
91 activity.finish(); in provisionManagedProfile()
93 Toast.makeText(activity, "Device provisioning is not enabled. Stopping.", in provisionManagedProfile()
/developers/build/prebuilts/gradle/ActivityInstrumentation/Application/tests/src/com/example/android/activityinstrumentation/
DSampleTests.java61 Activity activity = getActivity(); in testSpinnerValuePersistedBetweenLaunches() local
66 final Spinner spinner1 = (Spinner) activity.findViewById(R.id.spinner); in testSpinnerValuePersistedBetweenLaunches()
67 activity.runOnUiThread(new Runnable() { in testSpinnerValuePersistedBetweenLaunches()
83 activity.finish(); in testSpinnerValuePersistedBetweenLaunches()
87 activity = this.getActivity(); in testSpinnerValuePersistedBetweenLaunches()
92 final Spinner spinner2 = (Spinner) activity.findViewById(R.id.spinner); in testSpinnerValuePersistedBetweenLaunches()
102 activity.runOnUiThread(new Runnable() { in testSpinnerValuePersistedBetweenLaunches()
111 activity.finish(); in testSpinnerValuePersistedBetweenLaunches()
115 activity = this.getActivity(); in testSpinnerValuePersistedBetweenLaunches()
118 final Spinner spinner3 = (Spinner) activity.findViewById(R.id.spinner); in testSpinnerValuePersistedBetweenLaunches()
/developers/samples/android/testing/ActivityInstrumentation/Application/tests/src/com/example/android/activityinstrumentation/
DSampleTests.java61 Activity activity = getActivity(); in testSpinnerValuePersistedBetweenLaunches() local
66 final Spinner spinner1 = (Spinner) activity.findViewById(R.id.spinner); in testSpinnerValuePersistedBetweenLaunches()
67 activity.runOnUiThread(new Runnable() { in testSpinnerValuePersistedBetweenLaunches()
83 activity.finish(); in testSpinnerValuePersistedBetweenLaunches()
87 activity = this.getActivity(); in testSpinnerValuePersistedBetweenLaunches()
92 final Spinner spinner2 = (Spinner) activity.findViewById(R.id.spinner); in testSpinnerValuePersistedBetweenLaunches()
102 activity.runOnUiThread(new Runnable() { in testSpinnerValuePersistedBetweenLaunches()
111 activity.finish(); in testSpinnerValuePersistedBetweenLaunches()
115 activity = this.getActivity(); in testSpinnerValuePersistedBetweenLaunches()
118 final Spinner spinner3 = (Spinner) activity.findViewById(R.id.spinner); in testSpinnerValuePersistedBetweenLaunches()
/developers/samples/android/connectivity/wifidirect/DirectP2P/Application/src/main/java/com/example/android/wifidirectp2p/
DWiFiDirectBroadcastReceiver.java36 private MainActivity activity; field in WiFiDirectBroadcastReceiver
44 MainActivity 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()
/developers/samples/android/content/documentsUi/ContentProviderPaging/kotlinApp/app/src/main/kotlin/com.example.android.contentproviderpaging/
DImageClientFragment.kt62 val activity = activity in onViewCreated() constant
63 val recyclerView = activity.findViewById<RecyclerView>(R.id.recyclerview) in onViewCreated()
65 mLayoutManager = LinearLayoutManager(activity) in onViewCreated()
69 mAdapter = ImageAdapter(activity) in onViewCreated()
82 activity.loaderManager in onViewCreated()
90 activity.loaderManager.restartLoader(0, null, mLoaderCallback) in onViewCreated()
98 val activity = this@ImageClientFragment.activity in onCreateLoader() constant
99 return object : CursorLoader(activity) { in onCreateLoader()
104 return activity.contentResolver in onCreateLoader()
128 val activity = this@ImageClientFragment.activity in onLoadFinished() constant
[all …]
/developers/build/prebuilts/gradle/ContentProviderPaging/kotlinApp/app/src/main/kotlin/com.example.android.contentproviderpaging/
DImageClientFragment.kt62 val activity = activity in onViewCreated() constant
63 val recyclerView = activity.findViewById<RecyclerView>(R.id.recyclerview) in onViewCreated()
65 mLayoutManager = LinearLayoutManager(activity) in onViewCreated()
69 mAdapter = ImageAdapter(activity) in onViewCreated()
82 activity.loaderManager in onViewCreated()
90 activity.loaderManager.restartLoader(0, null, mLoaderCallback) in onViewCreated()
98 val activity = this@ImageClientFragment.activity in onCreateLoader() constant
99 return object : CursorLoader(activity) { in onCreateLoader()
104 return activity.contentResolver in onCreateLoader()
128 val activity = this@ImageClientFragment.activity in onLoadFinished() constant
[all …]
/developers/build/templates/ActivityCards/_MODULE_/src/template/res/values/
Dactivitycards-strings.xml.ftl21 <#list sample.activity as activity>
22 … <string name="<@make_activity_res activity "title"/>">${activity.title!"activity.title"}</string>
23 …<string name="<@make_activity_res activity "description"/>">${activity.description!"activity.descr…
/developers/build/prebuilts/gradle/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/
DDeviceOwnerFragment.java155 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()
179 mAdapter = new LauncherAdapter(activity, list); in retrieveCurrentSettings()
181 String packageName = loadPersistentPreferredLauncher(activity); in retrieveCurrentSettings()
247 private static String loadPersistentPreferredLauncher(Activity activity) { in loadPersistentPreferredLauncher() argument
[all …]
/developers/samples/android/admin/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/
DDeviceOwnerFragment.java155 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()
179 mAdapter = new LauncherAdapter(activity, list); in retrieveCurrentSettings()
181 String packageName = loadPersistentPreferredLauncher(activity); in retrieveCurrentSettings()
247 private static String loadPersistentPreferredLauncher(Activity activity) { in loadPersistentPreferredLauncher() argument
[all …]
/developers/build/prebuilts/gradle/PdfRendererBasic/kotlinApp/Application/src/androidTest/java/com/example/android/pdfrendererbasic/
DPdfRendererBasicFragmentTests.kt49 activityTestRule.activity.supportFragmentManager.beginTransaction() in before()
50 fragment = activityTestRule.activity.supportFragmentManager in before()
56 val expectedActivityTitle = activityTestRule.activity.getString( in testActivityTitle()
58 assertEquals(expectedActivityTitle, activityTestRule.activity.title) in testActivityTitle()
83 val expectedActivityTitle = activityTestRule.activity.getString( in testButtons_nextDisabledLastPage()
85 assertEquals(expectedActivityTitle, activityTestRule.activity.title) in testButtons_nextDisabledLastPage()
93 activityTestRule.activity.requestedOrientation = SCREEN_ORIENTATION_PORTRAIT in testOrientationChangePreserveState()
97 val expectedActivityTitle = activityTestRule.activity in testOrientationChangePreserveState()
99 assertEquals(expectedActivityTitle, activityTestRule.activity.title) in testOrientationChangePreserveState()
100 activityTestRule.activity.requestedOrientation = SCREEN_ORIENTATION_LANDSCAPE in testOrientationChangePreserveState()
[all …]
/developers/build/prebuilts/gradle/AppRestrictionEnforcer/Application/src/main/java/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 …]
/developers/samples/android/admin/AppRestrictionEnforcer/Application/src/main/java/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 …]
/developers/build/prebuilts/androidtv/visual-game-controller/src/com/example/android/visualgamecontroller/util/
DSystemUiHider.java110 public static SystemUiHider getInstance(Activity activity, View anchorView, int flags) { in getInstance() argument
112 return new SystemUiHiderHoneycomb(activity, anchorView, flags); in getInstance()
114 return new SystemUiHiderBase(activity, anchorView, flags); in getInstance()
118 protected SystemUiHider(Activity activity, View anchorView, int flags) { in SystemUiHider() argument
119 mActivity = activity; in SystemUiHider()
/developers/build/prebuilts/gradle/ContentProviderPaging/app/src/main/java/com/example/android/contentproviderpaging/
DImageClientFragment.java82 final Activity activity = getActivity(); in onViewCreated() local
84 RecyclerView recyclerView = (RecyclerView) activity.findViewById(R.id.recyclerview); in onViewCreated()
86 mLayoutManager = new LinearLayoutManager(activity); in onViewCreated()
90 mAdapter = new ImageAdapter(activity); in onViewCreated()
104 activity.getLoaderManager() in onViewCreated()
114 activity.getLoaderManager().restartLoader(0, null, mLoaderCallback); in onViewCreated()
124 final Activity activity = ImageClientFragment.this.getActivity(); in onCreateLoader() local
125 return new CursorLoader(activity) { in onCreateLoader()
131 return activity.getContentResolver() in onCreateLoader()
158 Activity activity = ImageClientFragment.this.getActivity(); in onLoadFinished() local
[all …]
/developers/samples/android/content/documentsUi/ContentProviderPaging/app/src/main/java/com/example/android/contentproviderpaging/
DImageClientFragment.java82 final Activity activity = getActivity(); in onViewCreated() local
84 RecyclerView recyclerView = (RecyclerView) activity.findViewById(R.id.recyclerview); in onViewCreated()
86 mLayoutManager = new LinearLayoutManager(activity); in onViewCreated()
90 mAdapter = new ImageAdapter(activity); in onViewCreated()
104 activity.getLoaderManager() in onViewCreated()
114 activity.getLoaderManager().restartLoader(0, null, mLoaderCallback); in onViewCreated()
124 final Activity activity = ImageClientFragment.this.getActivity(); in onCreateLoader() local
125 return new CursorLoader(activity) { in onCreateLoader()
131 return activity.getContentResolver() in onCreateLoader()
158 Activity activity = ImageClientFragment.this.getActivity(); in onLoadFinished() local
[all …]
/developers/samples/android/connectivity/nfc/CardReader/Application/src/main/java/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()
/developers/build/prebuilts/gradle/CardReader/Application/src/main/java/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()
/developers/build/templates/ActivityCards/_MODULE_/src/template/java/_PACKAGE_/
DMainActivity.java.ftl34 * A simple launcher activity offering access to the individual samples in this project.
45 <#if (sample.activity?size > 0)>
47 <#list sample.activity as activity>
48 …new Sample(R.string.<@make_activity_res activity "title"/>, R.string.<@make_activity_res activity
49 ${activity.class}.class),
53 /* TODO: Define at least one <activity> tag in template-params.xml like so:
54 <activity>
55 <class>[Java class that implements the activity]</class>
57 … <description>[One or two sentence description of what this activity does]</description>
58 </activity>
[all …]

12345678