Example usage for android.app Application getResources

List of usage examples for android.app Application getResources

Introduction

In this page you can find the example usage for android.app Application getResources.

Prototype

@Override
    public Resources getResources() 

Source Link

Usage

From source file:Main.java

public static float GetDensity(Application app) {
    if (app == null)
        return 1;
    return app.getResources().getDisplayMetrics().density;
}

From source file:com.dockerandroid.dagger.module.MainActivityModule.java

@Provides
@ActivityScope/*from ww  w  . ja  va2 s  . co m*/
List<String> providePageTitles(Application application) {
    return Arrays.asList(application.getResources().getStringArray(R.array.viewpage_titles));
}

From source file:com.outsystemscloud.andrevieira.secureDevice.java

private void checkDevice() {
    boolean _isDeviceRooted = isDeviceRooted();
    boolean _isPasscodeSet = doesDeviceHaveSecuritySetup(this.cordova.getActivity());

    if (_isDeviceRooted || !_isPasscodeSet) {
        // Remove View
        View v = this.view.getView();
        ViewGroup viewParent = (ViewGroup) v.getParent();
        viewParent.removeView(v);//from  www  . j  av  a 2s . c  o  m

        // Show message and quit
        Application app = cordova.getActivity().getApplication();
        String package_name = app.getPackageName();
        Resources resources = app.getResources();
        String message = resources.getString(resources.getIdentifier("message", "string", package_name));
        String label = resources.getString(resources.getIdentifier("label", "string", package_name));
        this.alert(message, label);
    }
}