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.android.contacts.activities.DialtactsActivity.java

@Override
public void onClick(View view) {
    switch (view.getId()) {
    case R.id.searchButton: {
        enterSearchUi();/*ww w  .  j ava  2s  . c  o m*/
        break;
    }
    case R.id.overflow_menu: {
        if (mDialpadFragment != null) {
            PopupMenu popup = mDialpadFragment.constructPopupMenu(view);
            if (popup != null) {
                popup.show();
            }
        } else {
            Log.w(TAG, "DialpadFragment is null during onClick() event for " + view);
        }
        break;
    }
    default: {
        Log.wtf(TAG, "Unexpected onClick event from " + view);
        break;
    }
    }
}

From source file:com.example.android.recyclingbanks.MainActivity.java

@Override
public boolean onMarkerClick(Marker marker) {
    Log.wtf("!!!!!!!!!!!!onMarkerClick", "A marker was clicked!");
    if (marker.equals(homeMarkerFinal)) {
        // TODO make this launch the change home address screen
        Log.wtf("markerClicked", "!!!!");
        Intent settingsIntent = new Intent(MainActivity.this, SettingsActivity.class);
        // send through address from gps, defaults to Edinburgh if not using gps
        settingsIntent.putExtra("userAddress", mAddressOutput);
        startActivity(settingsIntent);/* www.  j av a2 s  .  c o  m*/
    } else {
        marker.showInfoWindow();
    }
    return true;
}

From source file:com.android.dialer.DialtactsActivity.java

@Override
public void onClick(View view) {
    int resId = view.getId();
    if (resId == R.id.floating_action_button) {
        if (mListsFragment.getCurrentTabIndex() == ListsFragment.TAB_INDEX_ALL_CONTACTS && !mInRegularSearch) {
            DialerUtils.startActivityWithErrorToast(this, IntentUtil.getNewContactIntent(),
                    R.string.add_contact_not_available);
        } else if (!mIsDialpadShown) {
            mInCallDialpadUp = false;//from w  w  w . j  a v  a  2s .  co m
            showDialpadFragment(true);
        }
    } else if (resId == R.id.voice_search_button) {
        try {
            startActivityForResult(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH),
                    ACTIVITY_REQUEST_CODE_VOICE_SEARCH);
        } catch (ActivityNotFoundException e) {
            Toast.makeText(DialtactsActivity.this, R.string.voice_search_not_available, Toast.LENGTH_SHORT)
                    .show();
        }
    } else if (resId == R.id.dialtacts_options_menu_button) {
        mOverflowMenu.show();
    } else {
        Log.wtf(TAG, "Unexpected onClick event from " + view);
    }
}

From source file:com.CloudRecognition.CloudReco.java

@Override
public boolean menuProcess(int command) {
    boolean result = true;

    switch (command) {
    case CMD_BACK:
        finish();//from   w  w w  .jav  a2 s . co  m
        break;

    case CMD_SESION:
        Log.wtf("HEY", "HO");
        comm.borrarBaseDeDatos();
        //Quizas haya que crear un nuevo comm   
        finish();
        break;

    case CMD_FLASH:
        result = CameraDevice.getInstance().setFlashTorchMode(!mFlash);

        if (result) {
            mFlash = !mFlash;
        } else {
            showToast(getString(mFlash ? R.string.menu_flash_error_off : R.string.menu_flash_error_on));
            Log.e(LOGTAG, getString(mFlash ? R.string.menu_flash_error_off : R.string.menu_flash_error_on));
        }
        break;

    case CMD_AUTOFOCUS:

        if (mContAutofocus) {
            result = CameraDevice.getInstance().setFocusMode(CameraDevice.FOCUS_MODE.FOCUS_MODE_NORMAL);

            if (result) {
                mContAutofocus = false;
            } else {
                showToast(getString(R.string.menu_contAutofocus_error_off));
                Log.e(LOGTAG, getString(R.string.menu_contAutofocus_error_off));
            }
        } else {
            result = CameraDevice.getInstance().setFocusMode(CameraDevice.FOCUS_MODE.FOCUS_MODE_CONTINUOUSAUTO);

            if (result) {
                mContAutofocus = true;
            } else {
                showToast(getString(R.string.menu_contAutofocus_error_on));
                Log.e(LOGTAG, getString(R.string.menu_contAutofocus_error_on));
            }
        }

        break;

    case CMD_EXTENDED_TRACKING:
        TrackerManager trackerManager = TrackerManager.getInstance();
        ImageTracker imageTracker = (ImageTracker) trackerManager.getTracker(ImageTracker.getClassType());

        TargetFinder targetFinder = imageTracker.getTargetFinder();

        if (targetFinder.getNumImageTargets() == 0) {
            result = false;
            showToast(getString(R.string.menu_extended_tracking_no_targets));
        }

        for (int tIdx = 0; tIdx < targetFinder.getNumImageTargets(); tIdx++) {
            Trackable trackable = targetFinder.getImageTarget(tIdx);

            if (!mExtendedTracking) {
                if (!trackable.startExtendedTracking()) {
                    Log.e(LOGTAG, "Failed to start extended tracking target");
                    result = false;
                } else {
                    Log.d(LOGTAG, "Successfully started extended tracking target");
                }
            } else {
                if (!trackable.stopExtendedTracking()) {
                    Log.e(LOGTAG, "Failed to stop extended tracking target");
                    result = false;
                } else {
                    Log.d(LOGTAG, "Successfully started extended tracking target");
                }
            }
        }

        if (result)
            mExtendedTracking = !mExtendedTracking;

        break;

    case CMD_CAMERA_FRONT:
    case CMD_CAMERA_REAR:
        // Turn off the flash
        if (mFlashOptionView != null && mFlash) {
            // OnCheckedChangeListener is called upon changing the checked state
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
                ((Switch) mFlashOptionView).setChecked(false);
            } else {
                ((CheckBox) mFlashOptionView).setChecked(false);
            }
        }

        doStopTrackers();
        CameraDevice.getInstance().stop();
        CameraDevice.getInstance().deinit();
        try {
            vuforiaAppSession.startAR(command == CMD_CAMERA_FRONT ? CameraDevice.CAMERA.CAMERA_FRONT
                    : CameraDevice.CAMERA.CAMERA_BACK);
        } catch (SampleApplicationException e) {
            showToast(e.getString());
            Log.e(LOGTAG, e.getString());
            result = false;
        }
        doStartTrackers();
        break;

    }

    return result;
}

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

/**
 * Retrieves an episode from a view and checks for null value.s
 * @param v//from   w  w  w .j av  a  2s  . co m
 * @return The episode or null, if it could not be extracted.
 */
private Episode getEpisodeFromView(View v) {
    if (v == null) {
        Log.wtf(TAG, "onAddToPlaylistClick(): View is null");
        return null;
    }

    Episode episode = (Episode) v.getTag();

    if (episode == null) {
        Log.wtf(TAG, "onAddToPlaylistClick(): episode is null");
        return null;
    }

    return episode;
}

From source file:com.google.appinventor.components.runtime.util.NativeOpenStreetMapController.java

@Override
public void updateFeatureSize(MapMarker aiMarker) {
    final Marker marker = (Marker) featureOverlays.get(aiMarker);
    if (marker == null) {
        return;/*from   www .  j av a  2  s.co  m*/
    }
    getMarkerDrawable(aiMarker, new AsyncCallbackPair<Drawable>() {
        @Override
        public void onFailure(String message) {
            Log.wtf(TAG, "Cannot find default marker");
        }

        @Override
        public void onSuccess(Drawable result) {
            marker.setIcon(result);
            view.invalidate();
        }
    });
}

From source file:com.example.android.recyclingbanks.MainActivity.java

@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
    // TODO may not be unpacking cameraPosition right, it seems to reset - wtf?
    cameraPosition = m_map.getCameraPosition();
    Log.wtf("onSaveInstanceState", "cameraPos: " + String.valueOf(cameraPosition));
    savedInstanceState.putParcelable("STATE_CAMERA_POSITION", cameraPosition);
    //savedInstanceState.putBundle("STATE_CAMERA_POSITION", args);
    if (savedInstanceState == null) {
        Log.wtf("onSaveInstanceState", "is null!!!!!!!!!");
    }//from  ww  w . j  av  a2  s .c o m
    super.onSaveInstanceState(savedInstanceState);
}

From source file:com.example.android.recyclingbanks.MainActivity.java

@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
    super.onRestoreInstanceState(savedInstanceState);
    if (savedInstanceState != null) {
        cameraPosition = savedInstanceState.getParcelable("STATE_CAMERA_POSITION");
        Log.wtf("onRestoreInstanceState", "should camPos " + String.valueOf(cameraPosition));
        //mBankLatLng = bundle.getParcelable("bankLatLng");
    } else if (savedInstanceState == null) {
        Log.wtf("onRestore..State", "state not restored");
    }// w w  w.j av  a 2s.com

}

From source file:com.example.android.recyclingbanks.MainActivity.java

@Override
public void onResume() {
    super.onResume();
    Log.wtf("onResume", "device rotated?");
    // TODO load activated markers
    Log.wtf("onResume", "map ready?" + Boolean.toString(mapReady));
    if (m_map == null) {
        Log.wtf("onResume", "map null!!!!");
    }/* w  w w. j a  v a  2  s  . c  o  m*/

    // TODO add activated markers
    // TODO restore gps point of focus for map camera from before
    // hide spinner monkey
    mProgressBar.setVisibility(ProgressBar.GONE);
    mSpinnerLayout.setVisibility(ProgressBar.GONE);

}

From source file:com.example.android.recyclingbanks.MainActivity.java

/**
 * Loads markers for a specific bank type.
 * hides all non relevant markers//from   ww w .j  a  v  a2 s. com
 */
@Override
public void onLoaderReset(android.content.Loader<Boolean> loader) {
    Log.e("onLoaderReset", "num paper bank markers: " + String.valueOf(mPaperBankMarkers.size()));
    Log.e("onLoaderReset", "num paper bank markerOpt: " + String.valueOf(mPaperBanks.size()));
    // reset it, changed device orientation, so clear out the adapter, and connected listView
    //adapter.clear();

    //        // reattach them to m_map
    ////        while (mapReady != true) {
    ////            Log.wtf("!!!onLoaderReset", "map ready? " + Boolean.toString(mapReady));
    ////        }
    if (cameraPosition == null) {
        Toast.makeText(this, "not got camera", Toast.LENGTH_SHORT).show();
        Log.wtf("onLoaderReset", "not got camera");
    }
    Log.wtf("!!!onLoaderReset", "map ready? " + Boolean.toString(mapReady) + " :)");
    //        hideOrShowBanks(mPaperBankMarkers, true);
    //        hideOrShowBanks(mPackagingBankMarkers, true);
    //        addBankListToMap(mPackagingBanks);
    //        setupMap();
}