get System Service by name - Android Android OS

Android examples for Android OS:Service

Description

get System Service by name

Demo Code


//package com.java2s;

import android.content.Context;

public class Main {
    @SuppressWarnings("unchecked")
    public static <T> T getSystemService(Context context, String name,
            T... type) {//from   www .ja v a 2s  .c o  m
        return (T) context.getSystemService(name);
    }
}

Related Tutorials