Example usage for android.util Log wtf

List of usage examples for android.util Log wtf

Introduction

In this page you can find the example usage for android.util Log wtf.

Prototype

public static int wtf(String tag, Throwable tr) 

Source Link

Document

What a Terrible Failure: Report an exception that should never happen.

Usage

From source file:com.makerfaireorlando.app.MainActivity.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putString("curChoice", mCurCheckPosition);
    String FILENAME = "json_file";
    if (mCacheJSONString != null) {
        try {/*from   www.  j  a v  a  2  s . co  m*/
            FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
            fos.write(mCacheJSONString.getBytes());
            fos.close();
        } catch (FileNotFoundException e) {
            Log.wtf("File not found", "I dont know what happend sorry");
        } catch (IOException e) {
            Log.wtf("IO Exception", "great");
        }
    }

}

From source file:org.mozilla.gecko.home.RemoteTabsPanel.java

private Fragment makeFragmentForAction(Action action) {
    if (action == null) {
        // This corresponds to no Account: neither Sync nor Firefox.
        return RemoteTabsStaticFragment.newInstance(R.layout.remote_tabs_setup);
    }/*  w w  w .  j a  v  a 2  s.c o  m*/

    switch (action) {
    case None:
        if (HardwareUtils.isTablet() && GeckoScreenOrientation.getInstance()
                .getAndroidOrientation() == Configuration.ORIENTATION_LANDSCAPE) {
            return new RemoteTabsSplitPlaneFragment();
        } else {
            return new RemoteTabsExpandableListFragment();
        }
    case NeedsVerification:
        return RemoteTabsStaticFragment.newInstance(R.layout.remote_tabs_needs_verification);
    case NeedsPassword:
        return RemoteTabsStaticFragment.newInstance(R.layout.remote_tabs_needs_password);
    case NeedsUpgrade:
        return RemoteTabsStaticFragment.newInstance(R.layout.remote_tabs_needs_upgrade);
    case NeedsFinishMigrating:
        return RemoteTabsStaticFragment.newInstance(R.layout.remote_tabs_needs_finish_migrating);
    default:
        // This should never happen, but we're confident we have a Firefox
        // Account at this point, so let's show the needs password screen.
        // That's our best hope of righting the ship.
        Log.wtf(LOGTAG, "Got unexpected action needed; offering needs password.");
        return RemoteTabsStaticFragment.newInstance(R.layout.remote_tabs_needs_password);
    }
}

From source file:com.thelastcrusade.soundstream.components.MusicLibraryFragment.java

protected PlaylistService getPlaylistService() {
    PlaylistService playlistService = null;

    try {//w ww . j a v  a 2s  . co  m
        playlistService = this.playlistServiceLocator.getService();
    } catch (ServiceNotBoundException e) {
        Log.wtf(TAG, e);
    }
    return playlistService;
}

From source file:com.thelastcrusade.soundstream.components.PlaybarFragment.java

private PlaylistService getPlaylistService() {
    PlaylistService playlistService = null;
    try {/*from ww w . ja  va 2 s .co  m*/
        playlistService = this.playlistServiceLocator.getService();
    } catch (ServiceNotBoundException e) {
        Log.wtf(TAG, e);
    }
    return playlistService;
}

From source file:me.mcmadbat.laststats.MainActivity.java

public void updateUserPicture() {
    try {//from w ww. j  av a2 s .  co  m
        File directory = new File(getApplicationContext().getFilesDir() + "/Images/");
        File file = new File(directory, "profile.jpeg");

        if (file.exists()) {
            Bitmap myBitmap = BitmapFactory.decodeFile(file.getAbsolutePath());
            this.userPhoto.setImageBitmap(myBitmap);
        } else {
            throw null;
        }
    } catch (Exception e) {
        Log.wtf("INFO", "Updating user picture failed");
    }
}

From source file:com.lightstreamer.demo.android.DetailsFragment.java

private MpnInfo getMpnInfo(double trigger) {

    ExtendedTableInfo tableInfo = this.currentSubscription.getTableInfo();

    Map<String, String> data = new HashMap<String, String>();
    data.put("stock_name", "${stock_name}");
    data.put("last_price", "${last_price}");
    data.put("time", "${time}");
    data.put("item", tableInfo.getItems()[0]);

    ExtendedTableInfo clone = null;//from  w ww  .jav a 2s  . c o  m
    try {
        clone = new ExtendedTableInfo(tableInfo.getItems(), "MERGE", mpnSubscriptionFields, false);
    } catch (SubscrException e) {
        Log.wtf(TAG, "can't happen");
    }
    clone.setDataAdapter("QUOTE_ADAPTER");

    MpnInfo info = new MpnInfo(clone, "Stock update", data);
    info.setDelayWhileIdle("false");
    info.setTimeToLive("300");

    //this.getLastPrice()

    info.setTriggerExpression(triggetToString(trigger, this.currentSubscription.getLastPrice()));

    return info;
}

From source file:com.cc.signalinfo.fragments.SignalFragment.java

/**
 * Formats the page footer with in the following format:
 * YEAR codingcreation.com | v. x.xx/* www.j ava2s.c  o m*/
 */
private void formatFooter() {
    try {
        String appVersion = activity.getPackageManager().getPackageInfo(activity.getPackageName(),
                0).versionName;

        setTextViewText(R.id.copyright, String.format(getString(R.string.copyright),
                Calendar.getInstance().get(Calendar.YEAR), appVersion));

        rootView.findViewById(R.id.copyright)
                .setContentDescription(String.format(getString(R.string.copyrightDescription), appVersion));
    } catch (PackageManager.NameNotFoundException ignored) {
        Log.wtf(TAG, "Could not display app version number!");
    }
}

From source file:com.achep.acdisplay.ui.activities.MainActivity.java

/**
 * Turns screen off and sends a test notification.
 *
 * @param cheat {@code true} if it simply starts {@link AcDisplayActivity},
 *              {@code false} if it turns device off and then uses notification
 *              to wake it up./*  ww w  .  jav  a2 s  . co  m*/
 */
private void startAcDisplayTest(boolean cheat) {
    if (cheat) {
        startActivity(new Intent(this, AcDisplayActivity.class));
        sendTestNotification(this);
        return;
    }

    int delay = getResources().getInteger(R.integer.config_test_notification_delay);

    PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
    PowerManager.WakeLock wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Test notification.");
    wakeLock.acquire(delay);

    try {
        // Go sleep
        DevicePolicyManager dpm = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE);
        dpm.lockNow();

        new Handler().postDelayed(new Runnable() {

            private final Context context = getApplicationContext();

            @Override
            public void run() {
                sendTestNotification(context);
            }
        }, delay);
    } catch (SecurityException e) {
        Log.wtf(TAG, "Failed to turn screen off!");
        wakeLock.release();
    }
}

From source file:free.yhc.feeder.model.Utils.java

private static void log(Class<?> cls, LogLV lv, String msg) {
    if (null == msg)
        return;//  www.ja va2  s .  c  o m

    StackTraceElement ste = Thread.currentThread().getStackTrace()[5];
    msg = ste.getClassName() + "/" + ste.getMethodName() + "(" + ste.getLineNumber() + ") : " + msg;

    if (ENABLE_LOGF) {
        try {
            sLogout.write(lv.pref + " " + msg + "\n");
            sLogout.flush();
        } catch (IOException e) {
        }
    } else {
        switch (lv) {
        case V:
            Log.v(cls.getSimpleName(), msg);
            break;
        case D:
            Log.d(cls.getSimpleName(), msg);
            break;
        case I:
            Log.i(cls.getSimpleName(), msg);
            break;
        case W:
            Log.w(cls.getSimpleName(), msg);
            break;
        case E:
            Log.e(cls.getSimpleName(), msg);
            break;
        case F:
            Log.wtf(cls.getSimpleName(), msg);
            break;
        }
    }
}

From source file:com.dubsar_dictionary.Dubsar.model.Model.java

/**
 * Fetch data synchronously from the server.
 *///from w  ww  . j a va  2s  . c  o  m
public void load() {
    try {
        /* simple HTTP mock for testing */
        mData = getMock();

        if (mData == null)
            mData = fetchData();

        JSONTokener tokener = new JSONTokener(mData);
        parseData(tokener.nextValue());
    }
    /* JSONException, ClientProtocolException and IOException
     * For now (and perhaps indefinitely), we handle them all alike.
     */
    catch (Exception e) {
        mError = true;
        mErrorMessage = e.getMessage();
        Log.wtf(TAG, e);
    }

    mComplete = true;
}