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.thelastcrusade.soundstream.components.NetworkFragment.java

private void registerReceivers() {
    this.broadcastRegistrar = new BroadcastRegistrar();
    this.broadcastRegistrar
            .addLocalAction(ConnectionService.ACTION_FIND_FINISHED, new IBroadcastActionHandler() {

                @Override//from  w ww  .jav  a  2 s  . com
                public void onReceiveAction(Context context, Intent intent) {
                    onFindFinished(intent);
                }
            }).addLocalAction(UserList.ACTION_USER_LIST_UPDATE, new IBroadcastActionHandler() {

                @Override
                public void onReceiveAction(Context context, Intent intent) {
                    updateUserView();
                }
            }).addLocalAction(ConnectionService.ACTION_GUEST_CONNECTED, new IBroadcastActionHandler() {
                @Override
                public void onReceiveAction(Context context, Intent intent) {
                    setDisconnectDisbandBtn();
                }
            }).addLocalAction(ConnectionService.ACTION_HOST_CONNECTED, new IBroadcastActionHandler() {
                @Override
                public void onReceiveAction(Context context, Intent intent) {
                    setDisconnectDisbandBtn();
                }
            }).addGlobalAction(BluetoothAdapter.ACTION_SCAN_MODE_CHANGED, new IBroadcastActionHandler() {

                @Override
                public void onReceiveAction(Context context, Intent intent) {
                    int mode = intent.getIntExtra(BluetoothAdapter.EXTRA_SCAN_MODE,
                            BluetoothAdapter.SCAN_MODE_NONE);

                    if (joinDifferentNetworkButton != null) {
                        switch (mode) {
                        case BluetoothAdapter.SCAN_MODE_NONE:
                        case BluetoothAdapter.SCAN_MODE_CONNECTABLE:
                            setButtonToDefaultState(joinDifferentNetworkButton);
                            isSearchingJoinDifferent = false;
                            break;
                        case BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE:
                            setButtonToSearchingState(joinDifferentNetworkButton);
                            isSearchingJoinDifferent = true;
                            break;
                        default:
                            Log.wtf(TAG, "Recieved scan mode changed with unknown mode");
                            break;
                        }
                    }

                }
            }).register(this.getActivity());
}

From source file:ch.uzh.supersede.feedbacklibrary.FeedbackActivity.java

private void initView() {
    allMechanismViews = new ArrayList<>();
    LayoutInflater layoutInflater = LayoutInflater.from(this);
    LinearLayout linearLayout = (LinearLayout) findViewById(
            R.id.supersede_feedbacklibrary_feedback_activity_layout);

    if (linearLayout != null) {
        for (int i = 0; i < allMechanisms.size(); ++i) {
            if (allMechanisms.get(i).isActive()) {
                MechanismView mechanismView = null;
                View view = null;
                String type = allMechanisms.get(i).getType();
                switch (type) {
                case Mechanism.ATTACHMENT_TYPE:
                    break;
                case Mechanism.AUDIO_TYPE:
                    mechanismView = new AudioMechanismView(layoutInflater, allMechanisms.get(i), getResources(),
                            this, getApplicationContext());
                    view = mechanismView.getEnclosingLayout();
                    break;
                case Mechanism.CATEGORY_TYPE:
                    mechanismView = new CategoryMechanismView(layoutInflater, allMechanisms.get(i));
                    view = mechanismView.getEnclosingLayout();
                    break;
                case Mechanism.RATING_TYPE:
                    mechanismView = new RatingMechanismView(layoutInflater, allMechanisms.get(i));
                    view = mechanismView.getEnclosingLayout();
                    break;
                case Mechanism.SCREENSHOT_TYPE:
                    mechanismView = new ScreenshotMechanismView(layoutInflater, allMechanisms.get(i), this,
                            allMechanismViews.size(), defaultImagePath);
                    view = mechanismView.getEnclosingLayout();
                    break;
                case Mechanism.TEXT_TYPE:
                    mechanismView = new TextMechanismView(layoutInflater, allMechanisms.get(i));
                    view = mechanismView.getEnclosingLayout();
                    break;
                default:
                    Log.wtf(TAG, "Unknown mechanism type '" + type + "'");
                    break;
                }//from  ww w  .j a  v  a  2s  .co m

                if (mechanismView != null && view != null) {
                    allMechanismViews.add(mechanismView);
                    linearLayout.addView(view);
                }
            }
        }

        layoutInflater.inflate(R.layout.send_feedback_layout, linearLayout);
    }
}

From source file:com.chalmers.feedlr.activity.FeedActivity.java

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (resultCode == Activity.RESULT_OK) {
        switch (requestCode) {
        case Clients.TWITTER:
            clientHandler.onTwitterAuthCallback(data);
            break;
        case Clients.FACEBOOK:
            clientHandler.onFacebookAuthCallback(requestCode, resultCode, data);
            break;
        default:/*w  ww .  j a v  a 2s .co  m*/
            Log.wtf(getClass().getName(), "Result callback from unknown intent");
        }
    }
}

From source file:com.android.deskclock.timer.TimerFullScreenFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View v = inflater.inflate(R.layout.timer_full_screen_fragment, container, false);

    // Handle arguments from parent
    Bundle bundle = getArguments();//from www. j av  a 2  s.c  om
    if (bundle != null && bundle.containsKey(Timers.TIMESUP_MODE)) {
        if (bundle.getBoolean(Timers.TIMESUP_MODE, false)) {
            try {
                mOnEmptyListListener = (OnEmptyListListener) getActivity();
            } catch (ClassCastException e) {
                Log.wtf(TAG, getActivity().toString() + " must implement OnEmptyListListener");
            }
        }
    }

    mFab = (ImageButton) v.findViewById(R.id.fab);
    mTimersList = (StaggeredGridView) v.findViewById(R.id.timers_list);
    // For tablets in landscape, the count will be 2. All else will be 1.
    mColumnCount = getResources().getInteger(R.integer.timer_column_count);
    mTimersList.setColumnCount(mColumnCount);
    // Set this to true; otherwise adding new views to the end of the list won't cause
    // everything above it to be filled in correctly.
    mTimersList.setGuardAgainstJaggedEdges(true);

    mTimersListPage = v.findViewById(R.id.timers_list_page);
    mTimerSetup = (TimerSetupView) v.findViewById(R.id.timer_setup);

    mPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
    mNotificationManager = (NotificationManager) getActivity().getSystemService(Context.NOTIFICATION_SERVICE);

    return v;
}

From source file:de.jadehs.jadehsnavigator.fragment.VorlesungsplanFragment.java

@Override
public void processFinished(ArrayList<VPlanItem> vPlanItems) {
    Log.wtf("ASYNC", "ASYNC TASK FINISHED");
    try {/*from ww w . j a  va  2  s .  co m*/
        VPlanPagerAdapter vPlanPagerAdapter = new VPlanPagerAdapter(getActivity(), vPlanItems, weekOfYear);
        vPlanPagerAdapter.setIsCustomVPlanShown(false);
        viewpager = (ViewPager) getActivity().findViewById(R.id.vplan_viewpager);
        /**
         * Ermitteln des heutigen Wochentages, damit auf entsprechenden Tab gewechselt werden kann
         */
        viewpager.setAdapter(vPlanPagerAdapter);
        if (calendarHelper.getWeekNumber() == Integer.parseInt(weekOfYear))
            viewpager.setCurrentItem(calendarHelper.getDay());

        vPlanTabLayout = (VPlanTabLayout) getActivity().findViewById(R.id.vplan_sliding_tabs);
        vPlanTabLayout.setmViewPager(viewpager);

        getActivity().findViewById(R.id.progressVPlan).setVisibility(View.GONE);
        getActivity().findViewById(R.id.vplan_semester).setVisibility(View.GONE);

        if (!vPlanItems.isEmpty())
            getActivity().findViewById(R.id.empty_vplan).setVisibility(View.GONE);
        else
            getActivity().findViewById(R.id.empty_vplan).setVisibility(View.VISIBLE);
    } catch (Exception ex) {
        Log.wtf(TAG, "Err", ex);
    }
}

From source file:com.thelastcrusade.soundstream.CoreActivity.java

private MusicLibraryService getMusicLibraryService() {
    MusicLibraryService musicLibraryService = null;
    try {/*from  w  ww  .j  a  v  a  2 s .c  om*/
        musicLibraryService = this.musicLibraryLocator.getService();
    } catch (ServiceNotBoundException e) {
        Log.wtf(TAG, e);
    }
    return musicLibraryService;
}

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

public void parseItemList(String jsonString) {
    try {//from www. j a va  2 s.co m
        Gson gson = new Gson();
        projectsList = gson.fromJson(jsonString, ProjectsList.class);
        acceptedMakers = projectsList.accepteds;
        //Sort the accepted makers
        Collections.sort(acceptedMakers, new Comparator() {

            public int compare(Object o1, Object o2) {
                ProjectDetail p1 = (ProjectDetail) o1;
                ProjectDetail p2 = (ProjectDetail) o2;
                return p1.project_name.compareToIgnoreCase(p2.project_name);
            }

        });

        //get cats by delimiting ", " put to array for use in ProjectListFragment
        String[] tempCategories;
        for (int i = 0; i < acceptedMakers.size(); i++) {
            tempCategories = acceptedMakers.get(i).category.split(", ");

            for (int j = 0; j < tempCategories.length; j++) {
                String cat = tempCategories[j];

                if (!mCategories.contains(cat)) { // If the category is not in the Master Category List
                    mCategories.add(cat); // add it to the list
                    // Log.v("Category", "Added " + cat + " to the Master Category List");
                } else { // Else it is in the list
                    // Log.v("Category", cat + " was already in the Master Category List");
                }

            }
        }

        for (int i = 0; i < mCategories.size(); i++) {
            // Log.v("Catlist", mCategories.get(i).toString());
        }

    } catch (Exception e) {
        Log.wtf("com.makerfaireorlando.app.MainActivity", "Exception at GSON parse");
    }
}

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

protected void onStop() {
    mGoogleApiClient.disconnect();// ww w.j a v a  2s.co m
    // save camera position, screen may have gone to sleep during install, so try / catch
    try {
        cameraPosition = m_map.getCameraPosition();
    } catch (Exception e) {
        Log.e("onPause", e.toString());
    }
    Log.wtf("onPause", "cameraPos: " + String.valueOf(cameraPosition));
    m_map.clear();

    super.onStop();
    Log.e("onStop", "disconnecting from google, pins on map?");
    // TODO save state here, and reopen in onCreate
    Log.e("onStop", "might want to save stuff to open in onCreate if rebuilding UI");
}

From source file:com.digitalarx.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 {//from ww w .ja  v  a2 s.  c o  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:at.bitfire.davdroid.mirakel.webdav.WebDavResource.java

protected void checkResponse(StatusLine statusLine) throws HttpException {
    int code = statusLine.getStatusCode();

    if (code / 100 == 1 || code / 100 == 2) // everything OK
        return;//from   w w w.j  a va 2 s .  c  o m

    String reason = code + " " + statusLine.getReasonPhrase();
    switch (code) {
    case HttpStatus.SC_NOT_FOUND:
        Log.wtf(TAG, location.toString());
        throw new NotFoundException(reason);
    case HttpStatus.SC_PRECONDITION_FAILED:
        throw new PreconditionFailedException(reason);
    default:
        throw new HttpException(code, reason);
    }
}