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


Java FirebaseCrash.logcat方法代码示例

本文整理汇总了Java中com.google.firebase.crash.FirebaseCrash.logcat方法的典型用法代码示例。如果您正苦于以下问题:Java FirebaseCrash.logcat方法的具体用法?Java FirebaseCrash.logcat怎么用?Java FirebaseCrash.logcat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.firebase.crash.FirebaseCrash的用法示例。


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

示例1: onOptionsItemSelected

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case R.id.invite_menu:
            sendInvitation();
            return true;
        case R.id.crash_menu:
            FirebaseCrash.logcat(Log.ERROR, TAG, "crash caused");
            causeCrash();
            return true;
        case R.id.sign_out_menu:
            mFirebaseAuth.signOut();
            Auth.GoogleSignInApi.signOut(mGoogleApiClient);
            mFirebaseUser = null;
            mUsername = ANONYMOUS;
            mPhotoUrl = null;
            startActivity(new Intent(this, SignInActivity.class));
            finish();
            return true;
        case R.id.fresh_config_menu:
            fetchConfig();
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }
}
 
开发者ID:firebase,项目名称:friendlychat-android,代码行数:27,代码来源:MainActivity.java

示例2: setToList

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
/**
 * Load a stringset to a list of routeQueries
 *
 * @param set  The stringset
 * @param type The type which should be assigned to these queries
 * @return List of queries
 */
private <T extends Suggestable> ArrayList<Suggestion<T>> setToList(Set<String> set, SuggestionType type, Class<T> objectClass) {
    ArrayList<Suggestion<T>> results = new ArrayList<>(set.size());

    for (String entry : set) {
        try {
            JSONObject object = new JSONObject(entry);

            T suggestionData = objectClass.newInstance();
            suggestionData.deserialize(object);

            Suggestion<T> s = new Suggestion<>(suggestionData, type);
            results.add(s);

        } catch (JSONException exception) {
            FirebaseCrash.logcat(Level.WARNING.intValue(), "PersistentQuery", "Failed to load routequery for type " + type.toString() + ": " + exception.getMessage());
            // ignored
        } catch (IllegalAccessException | InstantiationException e) {
            e.printStackTrace();
        }
    }

    return results;
}
 
开发者ID:hyperrail,项目名称:hyperrail-for-android,代码行数:31,代码来源:PersistentQueryProvider.java

示例3: getStationNames

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
/**
 * @inheritDoc
 */
@Override
@AddTrace(name="StationsDb.getStationNames")
public String[] getStationNames(Station[] Stations) {

    if (Stations == null || Stations.length == 0) {
        FirebaseCrash.logcat(WARNING.intValue(), LOGTAG, "Tried to load station names on empty station list!");
        return new String[0];
    }

    String[] results = new String[Stations.length];
    for (int i = 0; i < Stations.length; i++) {
        results[i] = Stations[i].getLocalizedName();
    }
    return results;
}
 
开发者ID:hyperrail,项目名称:hyperrail-for-android,代码行数:19,代码来源:StationsDb.java

示例4: onCreate

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
/**
 * Create the database.
 *
 * @param db Handle in which the database should be created.
 */
public void onCreate(SQLiteDatabase db) {
    FirebaseCrash.logcat(INFO.intValue(), LOGTAG, "Creating stations database");

    db.execSQL(SQL_CREATE_TABLE_STATIONS);
    db.execSQL(SQL_CREATE_TABLE_FACILITIES);

    FirebaseCrash.logcat(INFO.intValue(), LOGTAG, "Filling stations database");
    fill(db);
    FirebaseCrash.logcat(INFO.intValue(), LOGTAG, "Stations database ready");
}
 
开发者ID:hyperrail,项目名称:hyperrail-for-android,代码行数:16,代码来源:StationsDb.java

示例5: getParserInstance

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
private static IrailParser getParserInstance() {
    if (IrailFactory.parserInstance == null) {
        FirebaseCrash.logcat(SEVERE.intValue(), "Irail16Factory", "Failed to provide station provider! Call setup() before calling any factory method!");
        FirebaseCrash.report(new Exception("IrailApiParser was requested before the factory was initialized"));
        throw new IllegalStateException();
    }
    return parserInstance;
}
 
开发者ID:hyperrail,项目名称:hyperrail-for-android,代码行数:9,代码来源:IrailFactory.java

示例6: getStationsProviderInstance

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
public static IrailStationProvider getStationsProviderInstance() {
    if (IrailFactory.stationProviderInstance == null) {
        FirebaseCrash.logcat(SEVERE.intValue(), "Irail16Factory", "Failed to provide station provider! Call setup() before calling any factory method!");
        FirebaseCrash.report(new Exception("IrailStationProvider was requested before the factory was initialized"));
        throw new IllegalStateException();
    }
    return stationProviderInstance;
}
 
开发者ID:hyperrail,项目名称:hyperrail-for-android,代码行数:9,代码来源:IrailFactory.java

示例7: getDataProviderInstance

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
public static IrailDataProvider getDataProviderInstance() {
    if (IrailFactory.dataProviderInstance == null) {
        FirebaseCrash.logcat(SEVERE.intValue(), "Irail16Factory", "Failed to provide data provider! Call setup() before calling any factory method!");
        FirebaseCrash.report(new Exception("IrailDataProvider was requested before the factory was initialized"));
        throw new IllegalStateException();
    }
    return dataProviderInstance;
}
 
开发者ID:hyperrail,项目名称:hyperrail-for-android,代码行数:9,代码来源:IrailFactory.java

示例8: loadStationCursor

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
/**
 * Load stations from a cursor. This method <strong>does not close the cursor afterwards</strong>.
 *
 * @param c The cursor from which stations should be loaded.
 * @return The array of loaded stations
 */
private Station[] loadStationCursor(Cursor c) {
    if (c.isClosed()) {
        FirebaseCrash.logcat(SEVERE.intValue(), LOGTAG, "Tried to load closed cursor");
        return null;
    }

    if (c.getCount() == 0) {
        FirebaseCrash.logcat(SEVERE.intValue(), LOGTAG, "Tried to load cursor with 0 results!");
        return null;
    }

    c.moveToFirst();
    Station[] result = new Station[c.getCount()];
    int i = 0;
    while (!c.isAfterLast()) {

        String locale = PreferenceManager.getDefaultSharedPreferences(context).getString("pref_stations_language", "");
        if (locale.isEmpty()) {
            // Only get locale when needed
            locale = Locale.getDefault().getISO3Language();
            PreferenceManager.getDefaultSharedPreferences(context).edit().putString("pref_stations_language", locale).apply();
        }

        String name = c.getString(c.getColumnIndex(StationsDataColumns.COLUMN_NAME_NAME));
        String localizedName = null;

        String nl = c.getString(c.getColumnIndex(StationsDataColumns.COLUMN_NAME_ALTERNATIVE_NL));
        String fr = c.getString(c.getColumnIndex(StationsDataColumns.COLUMN_NAME_ALTERNATIVE_FR));
        String de = c.getString(c.getColumnIndex(StationsDataColumns.COLUMN_NAME_ALTERNATIVE_DE));
        String en = c.getString(c.getColumnIndex(StationsDataColumns.COLUMN_NAME_ALTERNATIVE_EN));

        switch (locale) {
            case "nld":
                localizedName = nl;
                break;
            case "fra":
                localizedName = fr;
                break;
            case "deu":
                localizedName = de;
                break;
            case "eng":
                localizedName = en;
                break;
        }

        if (localizedName == null || localizedName.isEmpty()) {
            localizedName = name;
        }

        Station s = new Station(
                c.getString(c.getColumnIndex(StationsDataColumns._ID)),
                name,
                nl,
                fr,
                de,
                en,
                localizedName,
                c.getString(c.getColumnIndex(StationsDataColumns.COLUMN_NAME_COUNTRY_CODE)),
                c.getDouble(c.getColumnIndex(StationsDataColumns.COLUMN_NAME_LATITUDE)),
                c.getDouble(c.getColumnIndex(StationsDataColumns.COLUMN_NAME_LONGITUDE)),
                c.getFloat(c.getColumnIndex(StationsDataColumns.COLUMN_NAME_AVG_STOP_TIMES)));

        c.moveToNext();
        result[i] = s;
        i++;
    }
    return result;
}
 
开发者ID:hyperrail,项目名称:hyperrail-for-android,代码行数:76,代码来源:StationsDb.java

示例9: loadFacilitiesCursor

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
/**
 * Load stations from a cursor. This method <strong>does not close the cursor afterwards</strong>.
 *
 * @param c The cursor from which stations should be loaded.
 * @return The array of loaded stations
 */
private StationFacilities loadFacilitiesCursor(Cursor c) {
    if (c.isClosed()) {
        FirebaseCrash.logcat(SEVERE.intValue(), LOGTAG, "Tried to load closed cursor");
        return null;
    }

    if (c.getCount() == 0) {
        FirebaseCrash.logcat(SEVERE.intValue(), LOGTAG, "Tried to load cursor with 0 results!");
        return null;
    }

    c.moveToFirst();

    int[][] indices = new int[][]{
            new int[]{c.getColumnIndex(StationFacilityColumns.COLUMN_SALES_OPEN_MONDAY), c.getColumnIndex(StationFacilityColumns.COLUMN_SALES_CLOSE_MONDAY)},
            new int[]{c.getColumnIndex(StationFacilityColumns.COLUMN_SALES_OPEN_TUESDAY), c.getColumnIndex(StationFacilityColumns.COLUMN_SALES_CLOSE_MONDAY)},
            new int[]{c.getColumnIndex(StationFacilityColumns.COLUMN_SALES_OPEN_WEDNESDAY), c.getColumnIndex(StationFacilityColumns.COLUMN_SALES_CLOSE_WEDNESDAY)},
            new int[]{c.getColumnIndex(StationFacilityColumns.COLUMN_SALES_OPEN_THURSDAY), c.getColumnIndex(StationFacilityColumns.COLUMN_SALES_CLOSE_THURSDAY)},
            new int[]{c.getColumnIndex(StationFacilityColumns.COLUMN_SALES_OPEN_FRIDAY), c.getColumnIndex(StationFacilityColumns.COLUMN_SALES_CLOSE_FRIDAY)},
            new int[]{c.getColumnIndex(StationFacilityColumns.COLUMN_SALES_OPEN_SATURDAY), c.getColumnIndex(StationFacilityColumns.COLUMN_SALES_CLOSE_SATURDAY)},
            new int[]{c.getColumnIndex(StationFacilityColumns.COLUMN_SALES_OPEN_SUNDAY), c.getColumnIndex(StationFacilityColumns.COLUMN_SALES_CLOSE_SUNDAY)},
    };

    LocalTime[][] openingHours = new LocalTime[7][];
    DateTimeFormatter localTimeFormatter = DateTimeFormat.forPattern("HH:mm");
    for (int i = 0; i < 7; i++) {
        if (c.getString(indices[i][0]) == null) {
            openingHours[i] = null;
        } else {
            openingHours[i] = new LocalTime[2];
            openingHours[i][0] = LocalTime.parse(c.getString(indices[i][0]), localTimeFormatter);
            openingHours[i][1] = LocalTime.parse(c.getString(indices[i][0]), localTimeFormatter);
        }
    }

    return new StationFacilities(openingHours,
            c.getString(c.getColumnIndex(StationFacilityColumns.COLUMN_STREET)),
            c.getString(c.getColumnIndex(StationFacilityColumns.COLUMN_ZIP)),
            c.getString(c.getColumnIndex(StationFacilityColumns.COLUMN_CITY)),
            c.getInt(c.getColumnIndex(StationFacilityColumns.COLUMN_TICKET_VENDING_MACHINE)) == 1,
            c.getInt(c.getColumnIndex(StationFacilityColumns.COLUMN_LUGGAGE_LOCKERS)) == 1,
            c.getInt(c.getColumnIndex(StationFacilityColumns.COLUMN_FREE_PARKING)) == 1,
            c.getInt(c.getColumnIndex(StationFacilityColumns.COLUMN_TAXI)) == 1,
            c.getInt(c.getColumnIndex(StationFacilityColumns.COLUMN_BICYCLE_SPOTS)) == 1,
            c.getInt(c.getColumnIndex(StationFacilityColumns.COLUMN_BLUE_BIKE)) == 1,
            c.getInt(c.getColumnIndex(StationFacilityColumns.COLUMN_BUS)) == 1,
            c.getInt(c.getColumnIndex(StationFacilityColumns.COLUMN_TRAM)) == 1,
            c.getInt(c.getColumnIndex(StationFacilityColumns.COLUMN_METRO)) == 1,
            c.getInt(c.getColumnIndex(StationFacilityColumns.COLUMN_WHEELCHAIR_AVAILABLE)) == 1,
            c.getInt(c.getColumnIndex(StationFacilityColumns.COLUMN_RAMP)) == 1,
            c.getInt(c.getColumnIndex(StationFacilityColumns.COLUMN_DISABLED_PARKING_SPOTS)),
            c.getInt(c.getColumnIndex(StationFacilityColumns.COLUMN_ELEVATED_PLATFORM)) == 1,
            c.getInt(c.getColumnIndex(StationFacilityColumns.COLUMN_ESCALATOR_UP)) == 1,
            c.getInt(c.getColumnIndex(StationFacilityColumns.COLUMN_ESCALATOR_DOWN)) == 1,
            c.getInt(c.getColumnIndex(StationFacilityColumns.COLUMN_ELEVATOR_PLATFORM)) == 1,
            c.getInt(c.getColumnIndex(StationFacilityColumns.COLUMN_HEARING_AID_SIGNAL)) == 1);

}
 
开发者ID:hyperrail,项目名称:hyperrail-for-android,代码行数:65,代码来源:StationsDb.java


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