当前位置: 首页>>代码示例>>Java>>正文


Java Country类代码示例

本文整理汇总了Java中android.location.Country的典型用法代码示例。如果您正苦于以下问题:Java Country类的具体用法?Java Country怎么用?Java Country使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Country类属于android.location包,在下文中一共展示了Country类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCurrentCountryIso

import android.location.Country; //导入依赖的package包/类
public String getCurrentCountryIso() {
    if (mCountryIso == null) {
        Country country = new Country(Locale.getDefault().getCountry(), Country.COUNTRY_SOURCE_LOCALE);
        mCountryIso = country.getCountryIso();
    }
    return mCountryIso;
}
 
开发者ID:moezbhatti,项目名称:qksms,代码行数:8,代码来源:QKSMSAppBase.java

示例2: getCurrentCountryIso

import android.location.Country; //导入依赖的package包/类
public String getCurrentCountryIso() {
    if (mCountryIso == null) {
        Country country = mCountryDetector.detectCountry();
        if (country != null) {
            mCountryIso = country.getCountryIso();
        }
    }
    return mCountryIso;
}
 
开发者ID:slvn,项目名称:android-aosp-mms,代码行数:10,代码来源:MmsApp.java

示例3: onCreate

import android.location.Country; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    if (Log.isLoggable(LogTag.STRICT_MODE_TAG, Log.DEBUG)) {
        // Log tag for enabling/disabling StrictMode violation log. This will dump a stack
        // in the log that shows the StrictMode violator.
        // To enable: adb shell setprop log.tag.Mms:strictmode DEBUG
        StrictMode.setThreadPolicy(
                new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
    }

    sQKSMSApp = this;

    loadDefaultPreferenceValues();

    // Initialize analytics, leakcanary, and crittercism
    AnalyticsManager.getInstance().init(this);
    refWatcher = LeakCanary.install(this);

    // Figure out the country *before* loading contacts and formatting numbers
    Country country = new Country(Locale.getDefault().getCountry(), Country.COUNTRY_SOURCE_LOCALE);
    mCountryIso = country.getCountryIso();

    Context context = getApplicationContext();
    mPduLoaderManager = new PduLoaderManager(context);
    mThumbnailManager = new ThumbnailManager(context);

    registerActivityLifecycleCallbacks(new LifecycleHandler());

    ThemeManager.init(this);
    MmsConfig.init(this);
    Contact.init(this);
    DraftCache.init(this);
    Conversation.init(this);
    DownloadManager.init(this);
    RateController.init(this);
    LayoutManager.init(this);
    NotificationManager.init(this);
    LiveViewManager.init(this);
    QKPreferences.init(this);

    activePendingMessages();
}
 
开发者ID:moezbhatti,项目名称:qksms,代码行数:45,代码来源:QKSMSAppBase.java

示例4: onCreate

import android.location.Country; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    if (Log.isLoggable(LogTag.STRICT_MODE_TAG, Log.DEBUG)) {
        // Log tag for enabling/disabling StrictMode violation log. This will dump a stack
        // in the log that shows the StrictMode violator.
        // To enable: adb shell setprop log.tag.Mms:strictmode DEBUG
        StrictMode.setThreadPolicy(
                new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
    }

    sMmsApp = this;

    // Load the default preference values
    PreferenceManager.setDefaultValues(this, R.xml.preferences, false);

    // Figure out the country *before* loading contacts and formatting numbers
    mCountryDetector = (CountryDetector) getSystemService(Context.COUNTRY_DETECTOR);
    mCountryListener = new CountryListener() {
        @Override
        public synchronized void onCountryDetected(Country country) {
            mCountryIso = country.getCountryIso();
        }
    };
    mCountryDetector.addCountryListener(mCountryListener, getMainLooper());
    mCountryIso = mCountryDetector.detectCountry().getCountryIso();

    Context context = getApplicationContext();
    mPduLoaderManager = new PduLoaderManager(context);
    mThumbnailManager = new ThumbnailManager(context);

    MmsConfig.init(this);
    Contact.init(this);
    DraftCache.init(this);
    Conversation.init(this);
    DownloadManager.init(this);
    RateController.init(this);
    LayoutManager.init(this);
    SmileyParser.init(this);
    MessagingNotification.init(this);

    /** zzz */
    // initialize cache for contacts
    initContactsCache();
}
 
开发者ID:CommonQ,项目名称:sms_DualCard,代码行数:47,代码来源:MmsApp.java

示例5: onCreate

import android.location.Country; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    if (Log.isLoggable(LogTag.STRICT_MODE_TAG, Log.DEBUG)) {
        // Log tag for enabling/disabling StrictMode violation log. This will dump a stack
        // in the log that shows the StrictMode violator.
        // To enable: adb shell setprop log.tag.Mms:strictmode DEBUG
        StrictMode.setThreadPolicy(
                new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
    }

    sMmsApp = this;

    // Load the default preference values
    PreferenceManager.setDefaultValues(this, R.xml.preferences, false);

    // Figure out the country *before* loading contacts and formatting numbers
    mCountryDetector = (CountryDetector) getSystemService(Context.COUNTRY_DETECTOR);
    mCountryListener = new CountryListener() {
        @Override
        public synchronized void onCountryDetected(Country country) {
            mCountryIso = country.getCountryIso();
        }
    };
    mCountryDetector.addCountryListener(mCountryListener, getMainLooper());

    Context context = getApplicationContext();
    mPduLoaderManager = new PduLoaderManager(context);
    mThumbnailManager = new ThumbnailManager(context);

    MmsConfig.init(this);
    Contact.init(this);
    DraftCache.init(this);
    Conversation.init(this);
    DownloadManager.init(this);
    RateController.init(this);
    LayoutManager.init(this);
    MessagingNotification.init(this);

    activePendingMessages();
}
 
开发者ID:slvn,项目名称:android-aosp-mms,代码行数:43,代码来源:MmsApp.java


注:本文中的android.location.Country类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。