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:edu.stanford.mobisocial.dungbeetle.ImageGalleryActivity.java

public void doActivityForResult(ActivityCallout callout) {
    mCurrentCallout = callout;/*from   www .  j a  v  a2  s.  c om*/
    Intent launch = callout.getStartIntent();
    if (launch != null)
        startActivityForResult(launch, REQUEST_ACTIVITY_CALLOUT);
    else {
        Log.wtf(callout.getClass().getCanonicalName(),
                "I failed to return a valid intent, so something is probably very bad.");
        Toast.makeText(this, "Callback for object type failed! " + callout.getClass().getName(),
                Toast.LENGTH_SHORT).show();
    }
}

From source file:com.owncloud.android.ui.activity.FileDisplayActivity.java

private void initFragmentsWithFile() {
    if (getAccount() != null && getFile() != null) {
        // / First fragment
        OCFileListFragment listOfFiles = getListOfFilesFragment();
        if (listOfFiles != null) {
            listOfFiles.listDirectory(getCurrentDir());
        } else {/*w ww . j a  v a  2  s.  co m*/
            Log.e(TAG, "Still have a chance to lose the initializacion of list fragment >(");
        }

        // / Second fragment
        OCFile file = getFile();
        Fragment secondFragment = chooseInitialSecondFragment(file);
        if (secondFragment != null) {
            setSecondFragment(secondFragment);
            updateFragmentsVisibility(true);
            updateNavigationElementsInActionBar(file);

        } else {
            cleanSecondFragment();
        }

    } else {
        Log.wtf(TAG, "initFragments() called with invalid NULLs!");
        if (getAccount() == null) {
            Log.wtf(TAG, "\t account is NULL");
        }
        if (getFile() == null) {
            Log.wtf(TAG, "\t file is NULL");
        }
    }
}

From source file:de.elanev.studip.android.app.backend.net.oauth.SignInFragment.java

@Override
public void onSyncError(int status, VolleyError error) {
    if (getActivity() == null || error == null || error.networkResponse == null
            || error.networkResponse.statusCode == 404)
        return;//from  w  w  w  . ja v a 2  s . c  o m
    Log.wtf(TAG, "Sync error " + status);

    String genericErrorMessage = getString(R.string.sync_error_generic);
    String finalErrorMessage;
    switch (status) {
    case SyncHelper.SyncHelperCallbacks.ERROR_CONTACTS_SYNC:
        finalErrorMessage = String.format(genericErrorMessage, getString(R.string.contacts));
        break;
    case SyncHelper.SyncHelperCallbacks.ERROR_USER_SYNC:
        finalErrorMessage = String.format(genericErrorMessage, getString(R.string.user_profile_data));
        break;
    case SyncHelper.SyncHelperCallbacks.ERROR_SEMESTER_SYNC:
        finalErrorMessage = String.format(genericErrorMessage, getString(R.string.semesters));
        break;
    case SyncHelper.SyncHelperCallbacks.ERROR_NEWS_SYNC:
        finalErrorMessage = String.format(genericErrorMessage, getString(R.string.news));
        break;
    case SyncHelper.SyncHelperCallbacks.ERROR_COURSES_SYNC:
        finalErrorMessage = String.format(genericErrorMessage, getString(R.string.courses));
        break;
    case SyncHelper.SyncHelperCallbacks.ERROR_INSTITUTES_SYNC:
        finalErrorMessage = String.format(genericErrorMessage, getString(R.string.institutes));
        break;
    case SyncHelper.SyncHelperCallbacks.ERROR_MESSAGES_SYNC:
        finalErrorMessage = String.format(genericErrorMessage, getString(R.string.messages));
        break;
    case SyncHelper.SyncHelperCallbacks.ERROR_ROUTES_SYNC:
        finalErrorMessage = String.format(genericErrorMessage, "routes");
        break;
    default:
        finalErrorMessage = getString(R.string.sync_error_default);
    }

    StringBuilder builder = new StringBuilder(finalErrorMessage);

    String errMesg = error.getLocalizedMessage();
    if (errMesg != null) {
        builder.append(errMesg);
    } else {
        builder.append("HTTP-Code: ").append(error.networkResponse.statusCode);
    }

    Toast.makeText(mContext, builder.toString(), Toast.LENGTH_LONG).show();

    resetSignInActivityState();
    showLoginForm();
}

From source file:edu.umich.flowfence.service.Sandbox.java

private void releaseLocked() {
    if (localLOGV) {
        Log.v(TAG, "release: " + this, new RuntimeException());
    }//ww  w  .  j  a  v  a 2s. c o m
    int newCount = --mStartCount;
    if (newCount < 0) {
        Log.wtf(TAG, String.format("Sandbox %d stopped without starting %d times", mID, -newCount));
    } else if (newCount == 0) {
        unbind();
    }
}

From source file:de.earthlingz.oerszebra.DroidZebra.java

@Override
protected void onDestroy() {
    boolean retry = true;
    mZebraThread.setRunning(false);/* w  w  w  .j av a  2  s .c  o  m*/
    mZebraThread.interrupt(); // if waiting
    while (retry) {
        try {
            mZebraThread.join();
            retry = false;
        } catch (InterruptedException e) {
            Log.wtf("wtf", e);
        }
    }
    mZebraThread.clean();
    super.onDestroy();
}

From source file:edu.stanford.junction.provider.bluetooth.Junction.java

private BluetoothServerSocket getListeningBluetoothServerSocket() throws IOException {

    BluetoothServerSocket tmp;/*  w w  w  .j  a va2 s . c  o  m*/
    if (mConfig.securePairingRequired() || VERSION.SDK_INT < VERSION_CODES.GINGERBREAD_MR1) {
        tmp = mBtAdapter.listenUsingRfcommWithServiceRecord(BluetoothSwitchboardConfig.APP_NAME,
                mConfig.getUuid());
        if (DBG)
            Log.d(TAG, "Using secure bluetooth server socket");
    } else {
        try {
            // compatibility with pre SDK 10 devices
            Method listener = mBtAdapter.getClass().getMethod("listenUsingInsecureRfcommWithServiceRecord",
                    String.class, UUID.class);
            tmp = (BluetoothServerSocket) listener.invoke(mBtAdapter, BluetoothSwitchboardConfig.APP_NAME,
                    mConfig.getUuid());
            Log.d(TAG, "Using insecure bluetooth server socket");
        } catch (NoSuchMethodException e) {
            Log.wtf(TAG, "listenUsingInsecureRfcommWithServiceRecord not found");
            throw new IOException(e);
        } catch (InvocationTargetException e) {
            Log.wtf(TAG, "listenUsingInsecureRfcommWithServiceRecord not available on mBtAdapter");
            throw new IOException(e);
        } catch (IllegalAccessException e) {
            Log.wtf(TAG, "listenUsingInsecureRfcommWithServiceRecord not available on mBtAdapter");
            throw new IOException(e);
        }
    }
    return tmp;
}

From source file:edu.stanford.junction.provider.bluetooth.Junction.java

private BluetoothSocket createBluetoothSocket(BluetoothDevice device, UUID uuid) throws IOException {

    BluetoothSocket tmp;//from  ww w  .  ja v a2 s.  c  o m
    if (mConfig.securePairingRequired() || VERSION.SDK_INT < VERSION_CODES.GINGERBREAD_MR1) {
        tmp = device.createRfcommSocketToServiceRecord(uuid);
        if (DBG)
            Log.d(TAG, "Using secure bluetooth socket");
    } else {
        try {
            // compatibility with pre SDK 10 devices
            Method listener = device.getClass().getMethod("createInsecureRfcommSocketToServiceRecord",
                    UUID.class);
            tmp = (BluetoothSocket) listener.invoke(device, uuid);
            if (DBG)
                Log.d(TAG, "Using insecure bluetooth socket");
        } catch (NoSuchMethodException e) {
            Log.wtf(TAG, "createInsecureRfcommSocketToServiceRecord not found");
            throw new IOException(e);
        } catch (InvocationTargetException e) {
            Log.wtf(TAG, "createInsecureRfcommSocketToServiceRecord not available on mBtAdapter");
            throw new IOException(e);
        } catch (IllegalAccessException e) {
            Log.wtf(TAG, "createInsecureRfcommSocketToServiceRecord not available on mBtAdapter");
            throw new IOException(e);
        }
    }
    return tmp;
}

From source file:com.CloudRecognition.CloudReco.java

public void goToWebProfesional(View view) {
    Intent intent = new Intent(Intent.ACTION_VIEW);
    Log.wtf("direccion", urlWebProfesional);
    intent.setData(Uri.parse(urlWebProfesional));
    this.startActivity(intent);
}

From source file:org.botlibre.sdk.activity.ChatActivity.java

public void resetVideoErrorListener() {
    videoView.setOnErrorListener(new OnErrorListener() {
        @Override//from   w w  w.j  av  a2 s  .  com
        public boolean onError(MediaPlayer mp, int what, int extra) {
            Log.wtf("Video error", "what:" + what + " extra:" + extra);
            videoError = true;
            return true;
        }
    });
}

From source file:at.ac.tuwien.detlef.activities.MainActivity.java

@Override
public void onTabSelected(Tab tab, FragmentTransaction fragmentTransaction) {
    // When the given tab is selected, switch to the corresponding page in
    // the ViewPager.
    if (menu != null) {
        menu.clear();//  w w  w . j av a  2  s.c o  m
        switch (tab.getPosition()) {
        case SectionsPagerAdapter.POSITION_PODCASTS:
            getMenuInflater().inflate(R.menu.podcast_menu, menu);
            if (numPodSync.get() != -1) {
                showRefreshProgressBar();
            } else {
                // Hide progress bar explicitly because this also sets
                // up the listener.
                hideRefreshProgressBar();
            }
            break;
        case SectionsPagerAdapter.POSITION_EPISODES:
            getMenuInflater().inflate(R.menu.episode_menu, menu);
            setSearchManager();
            updateEpisodeFilterUiStatus();
            break;
        case SectionsPagerAdapter.POSITION_PLAYER:
            getMenuInflater().inflate(R.menu.player_menu, menu);
            break;
        default:
            Log.wtf(TAG, "Non-existent tab selected! Please fix");
        }
    }
    mViewPager.setCurrentItem(tab.getPosition());
}