android.util.Log#e ( )源码实例Demo

下面列出了android.util.Log#e ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: samba-documents-provider   文件: LoadStatTask.java
@Override
public Map<Uri, StructStat> doInBackground(Void... args) {
  Map<Uri, StructStat> stats = new HashMap<>(mMetadataMap.size());
  for (DocumentMetadata metadata : mMetadataMap.values()) {
    try {
      metadata.loadStat(mClient);
      if (isCancelled()) {
        return stats;
      }
    } catch(Exception e) {
      // Failed to load a stat for a child... Just eat this exception, the only consequence it may
      // have is constantly retrying to fetch the stat.
      Log.e(TAG, "Failed to load stat for " + metadata.getUri());
    }
  }
  return stats;
}
 
源代码2 项目: SSForms   文件: DirectoryFragment.java
@Override
public void onReceive(Context arg0, Intent intent) {
    Runnable r = new Runnable() {
        public void run() {
            try {
                if (currentDir == null) {
                    listRoots();
                } else {
                    listFiles(currentDir);
                }
            } catch (Exception e) {
                Log.e("tmessages", e.toString());
            }
        }
    };
    if (Intent.ACTION_MEDIA_UNMOUNTED.equals(intent.getAction())) {
        listView.postDelayed(r, 1000);
    } else {
        r.run();
    }
}
 
源代码3 项目: AndroidProjects   文件: ComplexActivity.java
@Override
public void handleMessage(Message msg) {
    super.handleMessage(msg);
    ComplexActivity activity = activityWeakReference.get();
    if (activity != null) {
        switch (msg.what) {
            case 0:
                activity.main_image_view.setImageResource(R.mipmap.ic_launcher);
                break;
            case 100:
                count++;
                Log.e("Edwin", "count = " + count);
                break;
        }
    }

}
 
源代码4 项目: financisto   文件: SmsTemplateListAsyncAdapter.java
@Override
public void onItemDismiss(int position, int dir) {
    Log.d (TAG, String.format("swipped %s pos to %s (%s)",
        position, dir == START ? "left" : dir == END ? "right" : "??", dir));

    final long itemId = listUtil.getItem(position).id;
    switch (dir) {
        case START: // left swipe
            editItem(itemId);
            break;
        case END: // right swipe
            deleteItem(itemId, position);
            break;
        default:
            Log.e(TAG, "unknown move: " + dir);
    }
}
 
源代码5 项目: MycroftCore-Android   文件: MainActivity.java
public static void loadExtension(Context context, String apkFile, String packageName) {
    Log.i(TAG, "Trying to load new class from apk.");
    final File dexInternalStoragePath = new File(context.getDir("extensions", Context.MODE_PRIVATE),
            apkFile + ".apk");
    final File optimizedDexOutputPath = context.getDir("outdex", Context.MODE_PRIVATE);
    Log.i(TAG, "dexInternalStoragePath: " + dexInternalStoragePath.getAbsolutePath());
    if (dexInternalStoragePath.exists()) {
        Log.i(TAG, "New apk found! " + apkFile);
        DexClassLoader dexLoader = new DexClassLoader(dexInternalStoragePath.getAbsolutePath(),
                optimizedDexOutputPath.getAbsolutePath(),
                null,
                ClassLoader.getSystemClassLoader().getParent());
        try {
            Class klazz = dexLoader.loadClass("ai.mycroft.extension." + packageName);
            Constructor constructor = klazz.getConstructor(String.class);
            Method method = klazz.getDeclaredMethod("getInfo");
            Object newObject = constructor.newInstance("New object info");
            Log.i(TAG, "New object has class: " + newObject.getClass().getName());
            Log.i(TAG, "Invoking getInfo on new object: " + method.invoke(newObject));
        } catch (Exception e) {
            Log.e(TAG, "Exception:", e);
        }
    } else {
        Log.i(TAG, "Sorry new apk doesn't exist.");
    }
}
 
源代码6 项目: Ticket-Analysis   文件: AxisBase.java
/**
 * Adds a new LimitLine to this axis.
 *
 * @param l
 */
public void addLimitLine(LimitLine l) {
    mLimitLines.add(l);

    if (mLimitLines.size() > 6) {
        Log.e("MPAndroiChart",
                "Warning! You have more than 6 LimitLines on your axis, do you really want " +
                        "that?");
    }
}
 
源代码7 项目: fritz-examples   文件: CameraConnectionFragment.java
/**
 * Stops the background thread and its {@link Handler}.
 */
private void stopBackgroundThread() {
    backgroundThread.quitSafely();
    try {
        backgroundThread.join();
        backgroundThread = null;
        backgroundHandler = null;
    } catch (final InterruptedException e) {
        Log.e(TAG, "Exception!" + e);
    }
}
 
源代码8 项目: date_picker_converter   文件: DatePickerDialog.java
@Override
public void onClick(View v) {
    //tryVibrate();
    Log.e("DATEPICKERDIALOG", "just to checking if its working or not" + v.getId());
    if (v.getId() == R.id.mdtp_date_picker_year) {
        Log.e("DATEPICKERDIALOG", "just to checking if its working or not: YEAR_VIEW");
        setCurrentView(YEAR_VIEW);
    } else if (v.getId() == R.id.mdtp_date_picker_month_and_day) {
        Log.e("DATEPICKERDIALOG", "just to checking if its working or not: datePickerMonthAndDay");
        setCurrentView(MONTH_AND_DAY_VIEW);
    }
}
 
源代码9 项目: aptoide-client-v8   文件: ImageLoader.java
public Target<Drawable> loadWithShadowCircleTransform(String url, ImageView imageView,
    @ColorInt int shadowColor) {
  Context context = weakContext.get();
  if (context != null) {
    return Glide.with(context)
        .load(AptoideUtils.IconSizeU.generateSizeStoreString(url, resources, windowManager))
        .apply(getRequestOptions().transform(
            new ShadowCircleTransformation(context, imageView, shadowColor)))
        .transition(DrawableTransitionOptions.withCrossFade())
        .into(imageView);
  } else {
    Log.e(TAG, "::loadWithShadowCircleTransform() Context is null");
  }
  return null;
}
 
源代码10 项目: VideoRecord   文件: UtilityAdapter.java
/** 底层回调 */
public static int ndkNotify(int key, int value) {
	if (mOnNativeListener != null) {
		mOnNativeListener.ndkNotify(key, value);
	} else {
		Log.e("ndkNotify", "ndkNotify key:" + key + ", value: " + value);
	}
	return 0;
}
 
源代码11 项目: RecordVideo   文件: CameraHelper.java
/**
 * 根据相机id获取相机对象
 * @param cameraId
 * @return
 */
public static Camera getCameraInstance(int cameraId){
    Camera c = null;
    try {
        c = Camera.open(cameraId); // attempt to get a Camera instance
    }
    catch (Exception e){
        Log.e(TAG, "open camera failed: " + e.getMessage());
        // Camera is not available (in use or does not exist)
    }
    return c; // returns null if camera is unavailable
}
 
源代码12 项目: AndHook   文件: HookHelper.java
public static Class<?> findClass(final String classname,
                                 final ClassLoader loader) {
    try {
        return loader.loadClass(classname);
    } catch (final Exception e) {
        Log.e(AndHook.LOG_TAG, "failed to find class " + classname
                + " on ClassLoader " + loader, e);
    }
    return null;
}
 
public synchronized boolean addNetdEventCallback(int callerType, INetdEventCallback callback) {
    if (!isValidCallerType(callerType)) {
        Log.e(TAG, "Invalid caller type: " + callerType);
        return false;
    }
    mNetdEventCallbackList[callerType] = callback;
    return true;
}
 
源代码14 项目: FimiX8-RE   文件: CrashHandler.java
public void uncaughtException(Thread thread, Throwable ex) {
    if (handleException(ex) || this.mDefaultHandler == null) {
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            Log.e(TAG, "error : ", e);
        }
        Process.killProcess(Process.myPid());
        System.exit(1);
        return;
    }
    this.mDefaultHandler.uncaughtException(thread, ex);
}
 
源代码15 项目: NewXmPluginSDK   文件: AutoTextView.java
public AutoTextView(Context context, AttributeSet attrs) {
    super(context, attrs);
    mContext = context;
    mHandler = new Handler(mContext.getMainLooper());
    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AutoTextView);
    mTextSize = a.getInt(R.styleable.AutoTextView_autoTextSize, 13);
    Log.e(TAG, "mTextSize: " + mTextSize);
    mTextColor = a.getColor(R.styleable.AutoTextView_autoTextColor, 0xFF999999);
    a.recycle();
    setFactory(this);
}
 
源代码16 项目: Yahala-Messenger   文件: PeerConnectionClient.java
private void reportError(final String errorMessage) {
    Log.e(TAG, "Peerconnection error: " + errorMessage);
    executor.execute(new Runnable() {
        @Override
        public void run() {
            if (!isError) {
                events.onPeerConnectionError(errorMessage);
                isError = true;
            }
        }
    });
}
 
源代码17 项目: AvatarTinderView   文件: TinderRVAdapter.java
@Override
    public boolean onItemMove(int fromPosition, int toPosition) {
        if (getListItem() == null) return false;
        Log.e("fromPosition: "  + fromPosition, "toPosition: " + toPosition);
//        Collections.swap(getListItem(), fromPosition, toPosition);
        moveList(getListItem(), fromPosition, toPosition);
//        if (toPosition == 0 || toPosition == 1){
//            notifyDataSetChanged();
//        }
//        else {
            notifyItemMoved(fromPosition, toPosition);
//        }
        return true;
    }
 
源代码18 项目: AndroidProjects   文件: MainActivity.java
@Override
protected void onRestart() {
    Log.e("Edwin", TAG + " —> onRestart");
    super.onRestart();
}
 
源代码19 项目: AndroidDemo   文件: CameraImageActivity.java
@Override
public void onError(@NonNull CameraDevice camera, int error) {
    camera.close();
    cameraDevice = null;
    Log.e(TAG, "ERROR = " + error);
}
 
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_error);

    Intent intent = getIntent();

    androidx.appcompat.widget.Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    Utility.setActionBarColor(this);
    Utility.setToolbar(this, toolbar, getResources().getString(R.string.error_report_title));
    toolbar.setTitleTextColor(getColor(R.color.black));

    androidx.appcompat.app.ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setTitle(R.string.error_report_title);
        actionBar.setDisplayShowTitleEnabled(true);
    }

    Button reportButton = findViewById(R.id.errorReportButton);
    userCommentBox = findViewById(R.id.errorCommentBox);
    TextView errorView = findViewById(R.id.errorView);
    TextView infoView = findViewById(R.id.errorInfosView);
    TextView errorMessageView = findViewById(R.id.errorMessageView);

    ActivityCommunicator ac = ActivityCommunicator.getCommunicator();
    returnActivity = ac.returnActivity;
    errorInfo = intent.getParcelableExtra(ERROR_INFO);
    errorList = intent.getStringArrayExtra(ERROR_LIST);

    // important add guru meditation
    addGuruMeditaion();
    currentTimeStamp = getCurrentTimeStamp();

    reportButton.setOnClickListener((View v) -> {
        Context context = this;
        new AlertDialog.Builder(context)
                .setIcon(android.R.drawable.ic_dialog_alert)
                .setTitle(R.string.privacy_policy_title)
                .setMessage(R.string.start_accept_privacy_policy)
                .setCancelable(false)
                .setNeutralButton(R.string.read_privacy_policy, (dialog, which) -> {
                    Intent webIntent = new Intent(Intent.ACTION_VIEW,
                            Uri.parse(context.getString(R.string.privacy_policy_url))
                    );
                    context.startActivity(webIntent);
                })
                .setPositiveButton(R.string.accept, (dialog, which) -> {
                    Intent i = new Intent(Intent.ACTION_SENDTO);
                    i.setType("text/html");
                    i.setData(Uri.parse("mailto:" + ERROR_EMAIL_ADDRESS))
                            .putExtra(Intent.EXTRA_SUBJECT, ERROR_EMAIL_SUBJECT)
                            .putExtra(Intent.EXTRA_TEXT,
                                    Html.fromHtml(buildHtml()));
                    startActivity(Intent.createChooser(i, "Send Email"));
                })
                .setNegativeButton(R.string.decline, (dialog, which) -> {
                    // do nothing
                })
                .show();

    });

    // normal bugreport
    buildInfo(errorInfo);
    if (errorInfo.message != 0) {
        errorMessageView.setText(errorInfo.message);
    } else {
        errorMessageView.setVisibility(View.GONE);
        findViewById(R.id.messageWhatHappenedView).setVisibility(View.GONE);
    }

    errorView.setText(formErrorText(errorList));

    //print stack trace once again for debugging:
    for (String e : errorList) {
        Log.e("Debugging Error :", e);
    }
}