Android ServiceInfo - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ServiceInfo class.

This code example shows how to use the following methods:loadLabel
            mEnabledListeners.remove(cn);
            saveEnabledListeners(); 
        } else { 
            // show a scary dialog 
            new ListenerWarningDialogFragment() 
                .setListenerInfo(cn, info.loadLabel(mPM).toString())
                .show(getFragmentManager(), "dialog");
        } 
    } 
 
    static class ViewHolder { 
        ImageView icon;
        TextView name;
        CheckBox checkbox;
        TextView description;
    } 
 
    class ListenerListAdapter extends ArrayAdapter<ServiceInfo> {
        final LayoutInflater mInflater;
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:loadLabel, loadIcon
 
        public void bindView(View view, int position) {
            ViewHolder vh = (ViewHolder) view.getTag();
            ServiceInfo info = getItem(position);
 
            vh.icon.setImageDrawable(info.loadIcon(mPM));
            vh.name.setText(info.loadLabel(mPM));
            if (SHOW_PACKAGE_NAME) {
                vh.description.setText(info.packageName);
                vh.description.setVisibility(View.VISIBLE);
            } else { 
                vh.description.setVisibility(View.GONE);
            } 
            vh.checkbox.setChecked(isListenerEnabled(info));
        } 
    } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:loadLabel
        if (cn != null) {
            PackageManager pm = mContext.getPackageManager();
            try { 
                ServiceInfo ri = pm.getServiceInfo(cn, 0);
                if (ri != null) {
                    return ri.loadLabel(pm);
                } 
            } catch (PackageManager.NameNotFoundException exc) {
                return null; // uninstalled? 
            } 
        } 
        return null; 
    } 
 
    public boolean isEnabled() { 
        return getBoolean(SCREENSAVER_ENABLED, mDreamsEnabledByDefault);
    } 
 
    public void setEnabled(boolean value) {
        logd("setEnabled(%s)", value);
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:loadLabel, loadIcon
 
        public void bindView(View view, int position) {
            ViewHolder vh = (ViewHolder) view.getTag();
            ServiceInfo info = getItem(position);
 
            vh.icon.setImageDrawable(info.loadIcon(mPM));
            vh.name.setText(info.loadLabel(mPM));
            if (SHOW_PACKAGE_NAME) {
                vh.description.setText(info.packageName);
                vh.description.setVisibility(View.VISIBLE);
            } else { 
                vh.description.setVisibility(View.GONE);
            } 
            vh.checkbox.setChecked(isListenerEnabled(info));
        } 
    } 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:loadLabel
	private MyEngineInfo getEngineInfo(ResolveInfo resolve, PackageManager pm) {
		ServiceInfo service = resolve.serviceInfo;
		if (service != null) {
			MyEngineInfo engine = new MyEngineInfo();
			engine.name = service.packageName;
			CharSequence label = service.loadLabel(pm);
			engine.label = TextUtils.isEmpty(label) ? engine.name : label
					.toString();
			return engine;
		} 
		return null; 
	} 
 
	@Kroll.method 
	public KrollDict getEngines() { 
		KrollDict data = new KrollDict();
		PackageManager pm = TiApplication.getInstance().getPackageManager();
		Intent intent = new Intent(Engine.INTENT_ACTION_TTS_SERVICE);
		List<ResolveInfo> resolveInfos = pm.queryIntentServices(intent,
				PackageManager.MATCH_DEFAULT_ONLY);
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:loadLabel
        if (cn != null) {
            PackageManager pm = mContext.getPackageManager();
            try { 
                ServiceInfo ri = pm.getServiceInfo(cn, 0);
                if (ri != null) {
                    return ri.loadLabel(pm);
                } 
            } catch (PackageManager.NameNotFoundException exc) {
                return null; // uninstalled? 
            } 
        } 
        return null; 
    } 
 
    public boolean isEnabled() { 
        return getBoolean(SCREENSAVER_ENABLED, mDreamsEnabledByDefault);
    } 
 
    public void setEnabled(boolean value) {
        logd("setEnabled(%s)", value);
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
    private ServiceInfo[] services;
 
    @Before 
    public void setUp() { 
        packageInfo = new PackageInfo();
        serviceInfo = new ServiceInfo();
        services = new ServiceInfo[]{serviceInfo};
    } 
 
    @Test 
    public void checkService() { 
        serviceInfo.name = GCMIntentService.class.getName();
        packageInfo.services = services;
        GCMUtilsVerifier.checkService(GCMIntentService.class.getPackage().getName(), packageInfo);
    } 
 
    @Test(expected = IllegalStateException.class) 
    public void checkService_nullServices() { 
        GCMUtilsVerifier.checkService("invalid.package", packageInfo);
    } 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Android ServiceInfo Questions & Answers:

See Code Examples for Android ServiceInfo Methods: