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.toan_itc.tn.Fragment.WebviewFragment.java

@Nullable
@Override/*from   w  ww .  jav a2s.  c  o  m*/
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
        @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_details, container, false);
    webView = (WebView) view.findViewById(R.id.webview);
    String url = getArguments().getString(EXTRA_URL);
    Log.wtf("url=", url);
    webView.setWebViewClient(new WebViewClient());
    WebSettings webSettings = webView.getSettings();
    webSettings.setJavaScriptEnabled(true);
    webView.loadUrl(url);
    return view;
}

From source file:com.example.ryan.weixindemo.util.DebugLog.java

public static void wtf(String message) {
    if (!isDebuggable())
        return;/*from w  w  w.jav  a 2s.c  om*/

    getMethodNames(new Throwable().getStackTrace());
    Log.wtf(className, createLog(message));
}

From source file:org.pixmob.droidlink.ui.AccountsFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    authDialog = AuthenticationProgressDialog.newInstance();

    final Account[] accounts = Accounts.list(getActivity());
    if (accounts.length == 0) {
        // This may happen on a device without Google apps:
        // the application cannot run.
        Log.wtf(TAG, "No accounts available");
    } else {//  w  w w  .  j a  v  a2s  .c om
        if (selectedAccount != null) {
            // Check if the selected account still exists:
            // the user may have deleted an account before going back to
            // this activity.
            boolean accountFound = false;
            for (final Account account : accounts) {
                if (account.name.equals(selectedAccount)) {
                    // The selected account exists: select it.
                    accountFound = true;
                    break;
                }
            }
            if (!accountFound) {
                selectedAccount = null;
            }
        }

        accountAdapter = new AccountAdapter(getActivity(), accounts);
        setListAdapter(accountAdapter);
    }
}

From source file:com.achep.acdisplay.receiver.LocalReceiverActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Intent intent = getIntent();//from   ww w . ja va 2  s  . co m
    if (intent != null) {
        handleIntent(intent);
    } else {
        Log.wtf(TAG, "Got an empty launch intent.");
    }

    finish();
}

From source file:cn.newgxu.android.bbs.util.NewgxuUtils.java

public static final String get(String url, String charset) {
    HttpClient client = new DefaultHttpClient();
    HttpGet get = new HttpGet(url);
    get.setHeader("Accept", "application/json");
    HttpResponse response = null;//  w  w w  . java 2s  . c  o m
    HttpEntity entity = null;
    Scanner scanner = null;
    try {
        response = client.execute(get);
        entity = response.getEntity();
        if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
            InputStream in = entity.getContent();
            scanner = new Scanner(in, charset == null ? "utf-8" : charset).useDelimiter("\\A");
            return scanner.hasNext() ? scanner.next() : null;
        }
    } catch (ClientProtocolException e) {
        Log.wtf(TAG, e);
    } catch (IOException e) {
        Log.wtf(TAG, e);
    } finally {
        try {
            if (entity != null) {
                entity.consumeContent();
            }
        } catch (IOException e) {
            Log.wtf(TAG, e);
        }
    }
    return null;
}

From source file:org.couchbase.health.PoolHealthReader.java

/**
 * Create a new instance of the PoolHealthReader
 * //from  ww  w .j av  a 2s .  co m
 * @param host
 * @param port
 * @param poolName
 */
public PoolHealthReader(String host, int port, String poolName) {
    this.poolName = poolName;
    spider = new WebSpider();
    URL u = null;
    try {
        u = new URL("http", host, port, "/pools");
    } catch (MalformedURLException e) {
        Log.wtf("poolhealthreader.malformed.url", e);
        e.printStackTrace();
    }
    bootstrapUrl = u;
}

From source file:com.owncloud.android.CrashlogSendActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mLogFilename = getIntent().getStringExtra(CrashHandler.KEY_CRASH_FILENAME);
    if (mLogFilename == null) {
        Log.wtf(TAG, "No file crashlog path given!");
        finish();//from  w  ww.ja  va  2  s. c o m
        return;
    }
    Log.i(TAG, "crashlog file path " + mLogFilename);

    showDialog(DIALOG_SUBMIT);
}

From source file:com.achep.acdisplay.receiver.LocalReceiverActivity.java

private void handleIntent(Intent intent) {
    String host = extractHost(intent);
    if (host == null) {
        Log.wtf(TAG, "Got an empty launch intent.");
        return;/*from   w ww  .ja v  a 2  s.  c om*/
    }

    switch (host) {
    case HOST_LAUNCH_DEVICE_ADMINS:
        Intent launchIntent = new Intent().setComponent(
                new ComponentName("com.android.settings", "com.android.settings.DeviceAdminSettings"));
        if (IntentUtils.hasActivityForThat(this, launchIntent)) {
            startActivity(launchIntent);
        } else {
            ToastUtils.showShort(this, getString(R.string.device_admin_could_not_be_started));
        }
        break;
    case HOST_UNINSTALL:
        Uri packageUri = Uri.parse("package:" + PackageUtils.getName(this));
        launchIntent = new Intent(Intent.ACTION_UNINSTALL_PACKAGE, packageUri);
        if (IntentUtils.hasActivityForThat(this, launchIntent)) {
            startActivity(launchIntent);
        } else {
            ToastUtils.showShort(this, getString(R.string.package_could_not_be_uninstalled));
        }
        break;
    default:
        Log.wtf(TAG, "Got an unknown intent: " + host);
        return;
    }

    Intent broadcastIntent = new Intent();
    broadcastIntent.setAction(host);
    LocalBroadcastManager.getInstance(this).sendBroadcast(broadcastIntent);
}

From source file:com.achep.activedisplay.receiver.LocalReceiverActivity.java

private void handleIntent(Intent intent) {
    String host = extractHost(intent);
    if (host == null) {
        Log.wtf(TAG, "Got an empty launch intent.");
        return;//from  w  ww . j av a 2  s .  co  m
    }

    switch (host) {
    case HOST_LAUNCH_DEVICE_ADMINS:
        Intent launchIntent = new Intent().setComponent(
                new ComponentName("com.android.settings", "com.android.settings.DeviceAdminSettings"));
        if (IntentUtils.hasActivityForThat(this, launchIntent)) {
            startActivity(launchIntent);
        } else {
            ToastUtils.showShort(this, getString(R.string.device_admin_could_not_be_started));
        }
        break;
    case HOST_UNINSTALL:
        Uri packageUri = Uri.parse("package:" + Project.getPackageName(this));
        launchIntent = new Intent(Intent.ACTION_UNINSTALL_PACKAGE, packageUri);
        if (IntentUtils.hasActivityForThat(this, launchIntent)) {
            startActivity(launchIntent);
        } else {
            ToastUtils.showShort(this, getString(R.string.package_could_not_be_uninstalled));
        }
        break;
    default:
        Log.wtf(TAG, "Got an unknown intent: " + host);
        return;
    }

    Intent broadcastIntent = new Intent();
    broadcastIntent.setAction(host);
    LocalBroadcastManager.getInstance(this).sendBroadcast(broadcastIntent);
}

From source file:com.github.jobs.ui.fragment.SOUserFetcherReceiver.java

@Override
protected void onFinished(Bundle resultData) {
    super.onFinished(resultData);
    FragmentManager fragmentManager = getFragmentManager();
    Fragment fragment = fragmentManager.findFragmentById(R.id.base_container);
    if (fragment instanceof SOUserPickerFragment) {
        SOUserPickerFragment soUserPickerFragment = (SOUserPickerFragment) fragment;
        ArrayList<SOUser> users = resultData.getParcelableArrayList(StackOverflowUserResolver.RESULT_USERS);
        soUserPickerFragment.updateItems(users);
    } else {/*  ww  w  .j a v  a2s.  co m*/
        Log.wtf("FragmentReceiver", "The fragment isn't an instance of SOUserFetcherReceiver");
    }
}