当前位置: 首页>>代码示例>>Java>>正文


Java L.d方法代码示例

本文整理汇总了Java中com.jecelyin.common.utils.L.d方法的典型用法代码示例。如果您正苦于以下问题:Java L.d方法的具体用法?Java L.d怎么用?Java L.d使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jecelyin.common.utils.L的用法示例。


在下文中一共展示了L.d方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getStackTraces

import com.jecelyin.common.utils.L; //导入方法依赖的package包/类
public static String getStackTraces(Context context) {
    CrashConstants.loadFromContext(context);
    File[] list = searchForStackTraces();

    StringBuilder sb = new StringBuilder();
    if ((list != null) && (list.length > 0)) {
        L.d("Found " + list.length + " stacktrace(s).");

        for (File file : list) {
            try {
                // Read contents of stack trace
                String stacktrace = contentsOfFile(file);
                sb.append("\n\n");
                sb.append(stacktrace);
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                file.delete();
            }
        }
    }
    return sb.toString();
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:24,代码来源:CrashUtils.java

示例2: read

import com.jecelyin.common.utils.L; //导入方法依赖的package包/类
private StringBuilder read() throws Exception, OutOfMemoryError {
    File f = rootFile != null && rootFile.isFile() ? rootFile : file;
    if(TextUtils.isEmpty(encoding))
        encoding = FileEncodingDetector.detectEncoding(f);

    L.d(file.getPath()+" encoding is "+encoding);
    LineNumberReader reader = new LineNumberReader(new InputStreamReader(new FileInputStream(f), encoding));

    char[] buf = new char[BUFFER_SIZE];
    int len;
    ssb = new StringBuilder(BUFFER_SIZE * 4);
    while ((len = reader.read(buf, 0, BUFFER_SIZE)) != -1) {
        ssb.append(buf, 0, len);
    }

    lineNumber = reader.getLineNumber() + 1;
    reader.close();

    return ssb;
}
 
开发者ID:jecelyin,项目名称:920-text-editor-v2,代码行数:21,代码来源:FileReader.java

示例3: prepare

import com.jecelyin.common.utils.L; //导入方法依赖的package包/类
private void prepare() throws Exception {
    if (process != null) {
        return;
    }
    L.d("CMD", "prepare start");

    try {
        process = Runtime.getRuntime().exec("su");
    } catch (Exception e) {
        //没有Root的设备无法执行su,但是要访问 / 根目录(用File.listFiles会返回null)
        process = Runtime.getRuntime().exec("/system/bin/sh");
    }
    inputStream = new BufferedReader(new InputStreamReader(process.getInputStream(), "UTF-8"));
    errorStream = new BufferedReader(new InputStreamReader(process.getErrorStream(), "UTF-8"));
    outputStream = new OutputStreamWriter(process.getOutputStream(), "UTF-8");

    inputReadTask = new ReadTask(inputStream, "CMD-INPUT");
    errorReadTask = new ReadTask(errorStream, "CMD-OUTPUT");

    inputReadTask.start();
    errorReadTask.start();
    start();
    L.d("CMD", "prepare end");
}
 
开发者ID:jecelyin,项目名称:920-text-editor-v2,代码行数:25,代码来源:ShellDaemon.java

示例4: destroyItem

import com.jecelyin.common.utils.L; //导入方法依赖的package包/类
/**
 * Remove a page for the given position.
 *
 * @param container The containing View from which the page will be removed.
 * @param position  The page position to be removed.
 * @param view      The same object that was returned by instantiateItem(View, int).
 */
@Override
public void destroyItem(ViewGroup container, int position, Object view) {
    L.d("remove page %d", position);
    if (mCurrentPrimaryItem == view)
        mCurrentPrimaryItem = null;
    container.removeView((View) view);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:15,代码来源:ViewPagerAdapter.java

示例5: onRestoreInstanceState

import com.jecelyin.common.utils.L; //导入方法依赖的package包/类
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
    try {
        super.onRestoreInstanceState(savedInstanceState);
    } catch (Exception e) {
        L.d(e); //ignore exception: Unmarshalling unknown type code 7602281 at offset 58340
    }
}
 
开发者ID:jecelyin,项目名称:920-text-editor-v2,代码行数:9,代码来源:MainActivity.java

示例6: onPostExecute

import com.jecelyin.common.utils.L; //导入方法依赖的package包/类
@Override
protected void onPostExecute(Release release) {
    Context context = contextWeakReference.get();
    if (release == null || context == null)
        return;

    List<Release.Assets> assetsList = release.getAssets();
    if (assetsList == null || assetsList.isEmpty())
        return;
    Release.Assets assets = assetsList.get(0);
    final String downloadUrl = assets.getBrowser_download_url();
    final int size = assets.getSize();

    if (context instanceof JecActivity) {
        if (((JecActivity)context).isDetached())
            return;
    } else if (context instanceof Activity) {
        if (((Activity)context).isFinishing())
            return;
    }
    try {
        new MaterialDialog.Builder(context)
                .canceledOnTouchOutside(false)
                .title(R.string.new_version_available)
                .content(R.string.new_version_update_content, release.getTagName(), release.getBody())
                .negativeText(R.string.cancel)
                .positiveText(R.string.upgrade)
                .onPositive(new MaterialDialog.SingleButtonCallback() {
                    @Override
                    public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
                        goToDownload(downloadUrl, size);
                    }
                }).show();
    } catch (Exception e) {
        L.d(e); //ignore: Bad window token, you cannot show a dialog before an Activity is created or after it'release hidden.
    }
}
 
开发者ID:jecelyin,项目名称:920-text-editor-v2,代码行数:38,代码来源:CheckUpgradeTask.java

示例7: processCommand

import com.jecelyin.common.utils.L; //导入方法依赖的package包/类
private void processCommand(Runner runner) throws Exception {
    L.d("CMD", runner.command());

    inputReadTask.setRunner(runner);
    errorReadTask.setRunner(runner);

    //write the command
    outputStream.write(runner.command() + "\n");
    outputStream.flush();

    //write the token...
    String line = "echo " + runner.token + "\n";
    outputStream.write(line);
    outputStream.flush();
}
 
开发者ID:jecelyin,项目名称:920-text-editor-v2,代码行数:16,代码来源:ShellDaemon.java

示例8: onCreate

import com.jecelyin.common.utils.L; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    pref = Pref.getInstance(this);
    MenuManager.init(this);

    setContentView(R.layout.main_activity);

    L.d(TAG, "onCreate");
    CrashDbHelper.getInstance(this).close(); //初始化一下

    mToolbar = (Toolbar) findViewById(R.id.toolbar);
    mLoadingLayout = (LinearLayout) findViewById(R.id.loading_layout);
    mTabPager = (TabViewPager) findViewById(R.id.tab_pager);
    mMenuRecyclerView = (RecyclerView) findViewById(R.id.menuRecyclerView);
    mDrawerLayout = (TranslucentDrawerLayout) findViewById(R.id.drawer_layout);
    mTabRecyclerView = (RecyclerView) findViewById(R.id.tabRecyclerView);
    mVersionTextView = (TextView) findViewById(R.id.versionTextView);

    mSymbolBarLayout = (SymbolBarLayout) findViewById(R.id.symbolBarLayout);
    mSymbolBarLayout.setOnSymbolCharClickListener(new SymbolBarLayout.OnSymbolCharClickListener() {
        @Override
        public void onClick(View v, String text) {
            insertText(text);
        }
    });

    if(!AppUtils.verifySign(getContext())) {
        UIUtils.showConfirmDialog(getContext(), getString(R.string.verify_sign_failure), new UIUtils.OnClickCallback() {
            @Override
            public void onOkClick() {
                SysUtils.startWebView(getContext(), "https://github.com/jecelyin/920-text-editor-v2/releases");
            }
        });
    }

    setStatusBarColor(mDrawerLayout);

    bindPreferences();
    setScreenOrientation();

    mDrawerLayout.setEnabled(false);
    mDrawerLayout.setScrimColor(Color.TRANSPARENT);

    final String version = SysUtils.getVersionName(this);
    mVersionTextView.setText(version);

    if(ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED
            || ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED
            ) {
        requestWriteExternalStoragePermission();
    } else {
        start();

        if (savedInstanceState == null && pref.isAutoCheckUpdates()) {
            mDrawerLayout.postDelayed(new Runnable() {
                @Override
                public void run() {
                    new CheckUpgradeTask(getContext()).checkVersion(version);
                }
            }, 3000);
        }
    }
}
 
开发者ID:jecelyin,项目名称:920-text-editor-v2,代码行数:65,代码来源:MainActivity.java

示例9: onConsoleMessage

import com.jecelyin.common.utils.L; //导入方法依赖的package包/类
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
    L.d("CONSOLE", consoleMessage.message() + " (#" + consoleMessage.lineNumber() + " " + consoleMessage.sourceId() + ")");
    return true;
}
 
开发者ID:jecelyin,项目名称:920-text-editor-v2,代码行数:6,代码来源:EditAreaView.java

示例10: finishComposingText

import com.jecelyin.common.utils.L; //导入方法依赖的package包/类
@Override
public boolean finishComposingText() {
    L.d("ICH", "finishComposingText");
    return ic.finishComposingText();
}
 
开发者ID:jecelyin,项目名称:920-text-editor-v2,代码行数:6,代码来源:InputConnectionHacker.java

示例11: commitCompletion

import com.jecelyin.common.utils.L; //导入方法依赖的package包/类
@Override
public boolean commitCompletion(CompletionInfo text) {
    L.d("ICH", "commitCompletion text=" + text);
    return ic.commitCompletion(text);
}
 
开发者ID:jecelyin,项目名称:920-text-editor-v2,代码行数:6,代码来源:InputConnectionHacker.java

示例12: beginBatchEdit

import com.jecelyin.common.utils.L; //导入方法依赖的package包/类
@Override
public boolean beginBatchEdit() {
    L.d("ICH", "beginBatchEdit");
    return ic.beginBatchEdit();
}
 
开发者ID:jecelyin,项目名称:920-text-editor-v2,代码行数:6,代码来源:InputConnectionHacker.java

示例13: endBatchEdit

import com.jecelyin.common.utils.L; //导入方法依赖的package包/类
@Override
public boolean endBatchEdit() {
    L.d("ICH", "endBatchEdit");
    return ic.endBatchEdit();
}
 
开发者ID:jecelyin,项目名称:920-text-editor-v2,代码行数:6,代码来源:InputConnectionHacker.java

示例14: run

import com.jecelyin.common.utils.L; //导入方法依赖的package包/类
public void run() {
    try {
        //as long as there is something to read, we will keep reading.
        while (!close || reader.ready() ) {
            String outputLine = reader.readLine();

            if (outputLine == null) {
                break;
            }

            L.d("CMD", "> " + outputLine);

            ArrayList<String> buffer = reader == errorStream ? error : result;
            if (buffer == null || runner == null) {
                doNext();
                continue;
            }

            Runner r = runner.get();
            if (r == null) {
                doNext();
                continue;
            }

            int pos = outputLine.indexOf(r.token);

            if (pos == -1) {
                buffer.add(outputLine);
            } else if (pos >= 0) {
                L.d("CND", "Found token, line: " + outputLine);
                String line = outputLine.substring(0, pos);
                if (!TextUtils.isEmpty(line))
                    buffer.add(line);

                r.done = true;
                Message message = getHandler().obtainMessage(MESSAGE_POST_RESULT,
                        new TaskResult(r, result, TextUtils.join("\n", error)));
                message.sendToTarget();

                doNext();
            }
        }

    } catch (IOException e) {
        L.e(e);
    } finally {
        L.d("CMD", "read finish");
        closeQuietly(outputStream);
        closeQuietly(errorStream);
        closeQuietly(inputStream);
        close = true;
    }
}
 
开发者ID:jecelyin,项目名称:920-text-editor-v2,代码行数:54,代码来源:ShellDaemon.java

示例15: writeCrashReport

import com.jecelyin.common.utils.L; //导入方法依赖的package包/类
public void writeCrashReport() {
    String path = CrashConstants.FILES_PATH + "/" + crashIdentifier + ".stacktrace";
    L.d("Writing unhandled exception to: " + path);

    BufferedWriter writer = null;

    try {
        writer = new BufferedWriter(new FileWriter(path));

        writeHeader(writer, FIELD_APP_PACKAGE, appPackage);
        writeHeader(writer, FIELD_APP_VERSION_CODE, appVersionCode);
        writeHeader(writer, FIELD_APP_VERSION_NAME, appVersionName);
        writeHeader(writer, FIELD_OS_VERSION, osVersion);
        writeHeader(writer, FIELD_OS_BUILD, osBuild);
        writeHeader(writer, FIELD_DEVICE_MANUFACTURER, deviceManufacturer);
        writeHeader(writer, FIELD_DEVICE_MODEL, deviceModel);
        writeHeader(writer, FIELD_THREAD_NAME, threadName);
        writeHeader(writer, FIELD_CRASH_REPORTER_KEY, reporterKey);

        writeHeader(writer, FIELD_APP_START_DATE, DATE_FORMAT.format(appStartDate));
        writeHeader(writer, FIELD_APP_CRASH_DATE, DATE_FORMAT.format(appCrashDate));

        writer.write("\n");
        writer.write(throwableStackTrace);

        writer.flush();

    } catch (IOException e) {
        L.e("Error saving crash report!", e);
    } finally {
        try {
            if (writer != null) {
                writer.close();
            }
        } catch (IOException e1) {
            L.e("Error saving crash report!", e1);
        }
    }


}
 
开发者ID:jecelyin,项目名称:920-text-editor-v2,代码行数:42,代码来源:CrashDetails.java


注:本文中的com.jecelyin.common.utils.L.d方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。