Best code examples for Android ComponentName class (android.content.ComponentName)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ComponentName class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android ComponentName examples from Open Source projects
This code example shows how to use the following methods:
114:	assertEquals(shadowAppWidgetManager.bindAppWidgetIdIfAllowed(12345, new ComponentName("", "")), true); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: toString, setComponent
18:	ComponentName comp = new ComponentName(context.getPackageName(), PingService.class.getName()); 
19:	ComponentName service = context.startService(new Intent().setComponent(comp)); 
-
22:	Log.e(TAG, "Could not start service " + comp.toString()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: flattenToString
89:	expected.flattenToString(), componentName.flattenToString()) 
90:	.isEqualTo(expected); 
-
95:	return hasComponent(new ComponentName(context, cls.getName())); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods:
212:	ComponentName name = new ComponentName(packageName, "LauncherActivity"); 
213:	rpm.addPreferredActivity(filter, 0, null, name); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
187:	ComponentName name = new ComponentName(packageName, "LauncherActivity"); 
188:	rpm.addPreferredActivity(filter, 0, null, name); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
250:	final ComponentName cn = new ComponentName(info.packageName, info.name); 
-
258:	.setListenerInfo(cn, info.loadLabel(mPM).toString()) 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
53:	intent.setComponent(new ComponentName(this, info.name)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
61:	ComponentName name=new ComponentName(activity.applicationInfo.packageName, 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getPackageName
38:	if (!topActivity.getPackageName().equals(context.getPackageName())) { 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setComponentEnabledSetting
24:	context.getPackageManager().setComponentEnabledSetting(new ComponentName("fm.last.android", "fm.last.android.activity.Player"), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: toString, setComponent
26:	ComponentName comp = new ComponentName(context.getPackageName(), YammerService.class.getName()); 
27:	ComponentName service = context.startService(new Intent().setComponent(comp)); 
-
31:	Log.e(getClass().getName(), "Could not start service " + comp.toString()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: flattenToShortString
690:	String componentIconKey = component.flattenToShortString(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: equals
306:	if (currentTask.topActivity.equals(currentTask.baseActivity) 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setComponent
14:	ComponentName cmp = new ComponentName(ctx.getPackageName(), ReportingService.class.getName()); 
15:	ctx.startService(new Intent().setComponent(cmp)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getClassName
46:	assertEquals(SubActivity.class.getCanonicalName(), component.getClassName()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getClassName, getPackageName
76:	if (!myName.getPackageName().equals( 
-
78:	|| !myName.getClassName().equals( 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
34:	ComponentName me=new ComponentName(ctxt, AppWidget.class); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
135:	final ComponentName cn = new ComponentName(info.packageName, 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
34:	mIntent.setComponent(new ComponentName("com.android.contacts", 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: flattenToString, getClassName, getPackageName
87:	packageInfo.activityInfo.name = componentName.getClassName(); 
-
89:	packageInfo.activityInfo.applicationInfo.packageName = componentName.getPackageName(); 
-
93:	mApplicationEnabledSettings.put(componentName.getPackageName(), appEnabledSetting); 
94:	mComponentEnabledSettings.put(componentName.flattenToString(), componentEnabledSetting); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getPackageName
392:	intent.setPackage(globalSearchActivity.getPackageName()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
52:	ComponentName locationReceiver = new ComponentName(context, 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getClassName
153:	ComponentName cn = new ComponentName("foo", 
-
156:	cn.getClassName(), PackageManager.GET_META_DATA); 
-
160:	cn.getClassName(), 0); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: flattenToString
55:	activity = cn.flattenToString(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: hashCode
592:	result = 31 * result + (componentName != null ? componentName.hashCode() : 0); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: equals
305:	sb.append(di.componentName.equals(mDefaultDream) ? '0' : '1'); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
34:	mIntent.setComponent(new ComponentName("com.android.contacts", 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: toString, setComponent
26:	ComponentName comp = new ComponentName(context.getPackageName(), ServiceCallTick.class.getName()); 
27:	ComponentName service = context.startService(new Intent().setComponent(comp)); 
-
34:	Log.e(TAG, "Could not start service " + comp.toString()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: updateAppWidget
26:	AppWidgetManager.getInstance(context).updateAppWidget(new ComponentName(context, WidgetProvider.class), getRemoteViews(context, xmpp, !email, web)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setComponentEnabledSetting
149:	final ComponentName c = new ComponentName(this, 
-
151:	getPackageManager().setComponentEnabledSetting(c, 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: makeRestartActivityTask
49:	intents[0] = Intent.makeRestartActivityTask(new ComponentName(this, 
50:	com.example.android.apis.ApiDemos.class)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: makeRestartActivityTask
49:	intents[0] = Intent.makeRestartActivityTask(new ComponentName(this, 
50:	com.example.android.apis.ApiDemos.class)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
42:	UnlockReceiver.class), 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setComponentEnabledSetting
87:	ComponentName component = new ComponentName(context, ConnectivityReceiver.class); 
-
89:	context.getPackageManager().setComponentEnabledSetting(component, 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getClassName, setComponent
36:	Log.i(LOG_TAG, "Stopping service " + serviceName.getClassName()); 
37:	context.stopService(new Intent().setComponent(serviceName)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setComponent
52:	.setComponent(new ComponentName(context, ScheduleWidgetProvider.class)) 
Full Snippet Info
6
CodeRank
Related Android ComponentName Questions & Answers:
Other Android ComponentName Examples
17:	    Log.w(LOG, "onUpdate method called");
18:	    // Get all ids
19:	    ComponentName thisWidget = new ComponentName(context,
20:	        MyWidgetProvider.class);
21:	    int[] allWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget);
-
17:	    Log.w(LOG, "onUpdate method called");
18:	    // Get all ids
19:	    ComponentName thisWidget = new ComponentName(context,
20:	        MyWidgetProvider.class);
21:	    int[] allWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget);

Read More

17:	    Intent intent = new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);
18:	    intent.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,
19:	        new ComponentName(this, MyWallpaperService.class));
20:	    startActivity(intent);
21:	  }

Read More

1:	DevicePolicyManager mDPM = (DevicePolicyManager)
2:	        context.getSystemService(Context.DEVICE_POLICY_SERVICE);
3:	ComponentName mPolicyAdmin = new ComponentName(context, PolicyAdmin.class);
4:	...
5:	mDPM.setPasswordQuality(mPolicyAdmin, PASSWORD_QUALITY_VALUES[mPasswordQuality]);
-
1:	DevicePolicyManager mDPM = (DevicePolicyManager)
2:	        context.getSystemService(Context.DEVICE_POLICY_SERVICE);
3:	ComponentName mPolicyAdmin = new ComponentName(context, PolicyAdmin.class);
4:	...
5:	mDPM.setPasswordQuality(mPolicyAdmin, PASSWORD_QUALITY_VALUES[mPasswordQuality]);

Read More

See Code Examples for Android ComponentName Methods: