Java Code Examples for android.app.Application#getString()

The following examples show how to use android.app.Application#getString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NotifyDeveloperHandler.java    From slf4android with MIT License 6 votes vote down vote up
NotifyDeveloperHandler(Application context, Iterable<String> emailAddress, LogLevel minLevel, final ActivityStateListener stateListener) {
    this.context = context;
    this.emailAddress = Lists.newArrayList(emailAddress);
    this.filter = new AtLeastFilter(minLevel);
    this.activityState = new WeakReference<>(stateListener);
    this.attachmentClassList = new ArrayList<>();
    this.shakeDetector = new ShakeDetector(new ShakeDetector.Listener() {
        @Override
        public void hearShake() {
            ActivityStateListener listener = activityState.get();
            if (listener != null) {
                if (listener.isAppInForeground()) {
                    beginPublishOnMainThread(new LogRecord(Level.INFO, "Report a problem with app"));
                } else {
                    Log.i(TAG, "Ignore shake event - the app appears to be in background");
                }
            } else {
                Log.i(TAG, "Ignore shake event - can't detect if app is in foreground (API < 14)");
            }
        }
    });
    this.emailSubject = context.getString(R.string.slf4android_email_subject) + context.getPackageName();
    this.emailBody = context.getString(R.string.slf4android_email_extra_text);
}
 
Example 2
Source File: TestActivityTest.java    From Awesome-WanAndroid with Apache License 2.0 4 votes vote down vote up
@Test
public void testApplication() {
    Application application = RuntimeEnvironment.application;
    String appName = application.getString(R.string.app_name);
    Assert.assertEquals("WanAndroid", appName);
}
 
Example 3
Source File: DownloadsDatabase.java    From Xndroid with GNU General Public License v3.0 4 votes vote down vote up
@Inject
public DownloadsDatabase(@NonNull Application application) {
    super(application, DATABASE_NAME, null, DATABASE_VERSION);
    DEFAULT_DOWNLOADS_TITLE = application.getString(R.string.untitled);
}
 
Example 4
Source File: BookmarkDatabase.java    From Xndroid with GNU General Public License v3.0 4 votes vote down vote up
@Inject
public BookmarkDatabase(@NonNull Application application) {
    super(application, DATABASE_NAME, null, DATABASE_VERSION);
    DEFAULT_BOOKMARK_TITLE = application.getString(R.string.untitled);
}
 
Example 5
Source File: GoogleSuggestionsModel.java    From Xndroid with GNU General Public License v3.0 4 votes vote down vote up
public GoogleSuggestionsModel(@NonNull Application application) {
    super(application, ENCODING);
    mSearchSubtitle = application.getString(R.string.suggestion);
}
 
Example 6
Source File: BaiduSuggestionsModel.java    From Xndroid with GNU General Public License v3.0 4 votes vote down vote up
public BaiduSuggestionsModel(@NonNull Application application) {
    super(application, ENCODING);
    mSearchSubtitle = application.getString(R.string.suggestion);
}
 
Example 7
Source File: DuckSuggestionsModel.java    From Xndroid with GNU General Public License v3.0 4 votes vote down vote up
public DuckSuggestionsModel(@NonNull Application application) {
    super(application, ENCODING);
    mSearchSubtitle = application.getString(R.string.suggestion);
}
 
Example 8
Source File: DownloadsDatabase.java    From JumpGo with Mozilla Public License 2.0 4 votes vote down vote up
@Inject
public DownloadsDatabase(@NonNull Application application) {
    super(application, DATABASE_NAME, null, DATABASE_VERSION);
    DEFAULT_DOWNLOADS_TITLE = application.getString(R.string.untitled);
}
 
Example 9
Source File: BookmarkDatabase.java    From JumpGo with Mozilla Public License 2.0 4 votes vote down vote up
@Inject
public BookmarkDatabase(@NonNull Application application) {
    super(application, DATABASE_NAME, null, DATABASE_VERSION);
    DEFAULT_BOOKMARK_TITLE = application.getString(R.string.untitled);
}