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


Java Log.e方法代码示例

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


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

示例1: setDrawerLeftEdgeSize

import android.util.Log; //导入方法依赖的package包/类
private void setDrawerLeftEdgeSize (Context context, DrawerLayout drawerLayout, float displayWidthPercentage) {
    if (context == null || drawerLayout == null) return;
    try {
        // 找到 ViewDragHelper 并设置 Accessible 为true
        Field leftDraggerField =
                drawerLayout.getClass().getDeclaredField("mRightDragger");//Right
        leftDraggerField.setAccessible(true);
        ViewDragHelper leftDragger = (ViewDragHelper) leftDraggerField.get(drawerLayout);

        // 找到 edgeSizeField 并设置 Accessible 为true
        Field edgeSizeField = leftDragger.getClass().getDeclaredField("mEdgeSize");
        edgeSizeField.setAccessible(true);
        int edgeSize = edgeSizeField.getInt(leftDragger);

        // 设置新的边缘大小
        int screenWidth = PixelUtil.getWidth(context);
        edgeSizeField.setInt(leftDragger, Math.max(edgeSize, (int) (screenWidth * displayWidthPercentage)));
    } catch (Exception e) {
        Log.e("aaa", "setDrawerLeftEdgeSize wrong");
    }
}
 
开发者ID:mangestudio,项目名称:GCSApp,代码行数:22,代码来源:ShoppingCartAdapter.java

示例2: onRtlSdrStopped

import android.util.Log; //导入方法依赖的package包/类
@Override
  public void onRtlSdrStopped() {
  	Log.d(TAG,"NativeRtlSdrListener - onRtlSdrStopped");
  	
  	// Inform listeners
for (final RtlSdrServiceListener listener : listeners){
          listener.onRtlSdrStopped();
      }

  	releaseWakeLock();
  	    	
  	if (pendingStartRtlSdrRequest!=null){
  		// Requested to stop AIS before starting again. Now it's time to start AIS

	try {
		Thread.sleep(3000);
	} catch (InterruptedException e) {
		Log.e(TAG,"start - wait for closed device",e);
	}
  		
      	nativeRtlSdr.startAis(pendingStartRtlSdrRequest);
      	pendingStartRtlSdrRequest=null;
  	}
  }
 
开发者ID:videgro,项目名称:Ships,代码行数:25,代码来源:RtlSdrAisService.java

示例3: onResume

import android.util.Log; //导入方法依赖的package包/类
@Override
public void onResume() {
    super.onResume();

    wakeLock.acquire();
    try {

        if (camId == 0) {
            //camera = Camera.open(Camera.CameraInfo.CAMERA_FACING_FRONT);
        }
        else {
           camera = Camera.open(Camera.CameraInfo.CAMERA_FACING_BACK);
        }
    } catch (Exception e) {
        Log.e(getString(R.string.app_name), "failed to open Camera");
        e.printStackTrace();
    }
    //camera = Camera.open();

    //startTime = System.currentTimeMillis();

    killme = false;
    mHandler.postDelayed(update, 20);
}
 
开发者ID:ivybao0628,项目名称:MorseKnown,代码行数:25,代码来源:DecodeFragment.java

示例4: Init

import android.util.Log; //导入方法依赖的package包/类
public void Init() throws IOException, InterruptedException {
    if(ctx==null){
        Log.e("TorTest", "Couldn't start Tor!");
        return;
    }
    String fileLocation = "torfiles";
    // Start the Tor Onion Proxy
    AndroidTorRelay node = new  AndroidTorRelay(ctx,fileLocation);
    int hiddenServicePort = 80;
    int localPort = node.getSocksPort();
    String OnionAdress = "xl5rbgygp2wbgdbn.onion";
    String localhost="127.0.0.1";

    Socket clientSocket = Utilities.socks4aSocketConnection(OnionAdress, hiddenServicePort, "127.0.0.1", localPort);

    ObjectOutputStream out = new ObjectOutputStream(clientSocket.getOutputStream());
    out.flush();

    out.writeObject("i am workingg");
    out.flush();
}
 
开发者ID:PanagiotisDrakatos,项目名称:T0rlib4Android,代码行数:22,代码来源:TorClientSocks4.java

示例5: getMediaStream

import android.util.Log; //导入方法依赖的package包/类
/**
 * Get local Media and add tracks to media stream.
 * @return
 */
private boolean getMediaStream() {
    // Add video stream
    mStream = mPeerConnectionFactory.createLocalMediaStream("ARDAMS");
    mVideoCapturer = createVideoCapturer();
    if(mStream.addTrack(createVideoTrack(mVideoCapturer)) &&
            mStream.addTrack(createAudioTrack(mAudioConstraints))) {
        Log.d(TAG, "Got local MediaStream.");
        return true;
    }

    // Add audio stream
    mStream.addTrack(createAudioTrack(mAudioConstraints));
    Log.e(TAG, "Can't get local MediaStream.");
    return false;
}
 
开发者ID:crazytaxii,项目名称:Achilles_Android,代码行数:20,代码来源:MainActivity.java

示例6: onReceive

import android.util.Log; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    String action = intent.getAction();
    if (BluetoothAdapter.ACTION_DISCOVERY_STARTED.equals(action)) {
        toast("开始搜索 ...");
    } else if (BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(action)) {
        toast("搜索结束");
    } else if (BluetoothDevice.ACTION_FOUND.equals(action)) {
        BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
        if (isNewDevice(device)) {
            deviceList.add(device);
            listAdapter.notifyDataSetChanged();
            Log.e(TAG, "---------------- " + device.getName());
        }
    }
}
 
开发者ID:QiaoJim,项目名称:BluetoothStudy,代码行数:17,代码来源:DeviceListFragment.java

示例7: isAccessibilitySettingsOn

import android.util.Log; //导入方法依赖的package包/类
/**
 * Checks if the Forge Auto fill accessibility service is enabled
 *
 * @param context application context
 * @return true = service enabled, false = service disabled
 */
public static boolean isAccessibilitySettingsOn(Context context) {
    int accessibilityEnabled = 0;
    final String service = context.getPackageName() + "/" + AccessibilityAutofillService.class.getCanonicalName();
    try {
        accessibilityEnabled = Settings.Secure.getInt(
                context.getApplicationContext().getContentResolver(),
                android.provider.Settings.Secure.ACCESSIBILITY_ENABLED);
    } catch (Settings.SettingNotFoundException e) {
        // If there is an error, log it
        Log.e(Forge.ERROR_LOG, e.getMessage());
    }
    TextUtils.SimpleStringSplitter mStringColonSplitter = new TextUtils.SimpleStringSplitter(':');

    if (accessibilityEnabled == 1) {
        String settingValue = Settings.Secure.getString(
                context.getApplicationContext().getContentResolver(),
                Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);
        if (settingValue != null) {
            mStringColonSplitter.setString(settingValue);
            while (mStringColonSplitter.hasNext()) {
                String accessibilityService = mStringColonSplitter.next();

                if (accessibilityService.equalsIgnoreCase(service)) {
                    return true;
                }
            }
        }
    }
    return false;
}
 
开发者ID:jthomperoo,项目名称:Forge,代码行数:37,代码来源:Util.java

示例8: initFBO

import android.util.Log; //导入方法依赖的package包/类
private void initFBO(int width, int height)
{
    Log.d(LOGTAG, "initFBO("+width+"x"+height+")");

    deleteFBO();

    GLES20.glGenTextures(1, texDraw, 0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texDraw[0]);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);

    GLES20.glGenTextures(1, texFBO, 0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texFBO[0]);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);

    //int hFBO;
    GLES20.glGenFramebuffers(1, FBO, 0);
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, FBO[0]);
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, texFBO[0], 0);
    Log.d(LOGTAG, "initFBO error status: " + GLES20.glGetError());

    int FBOstatus = GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER);
    if (FBOstatus != GLES20.GL_FRAMEBUFFER_COMPLETE)
        Log.e(LOGTAG, "initFBO failed, status: " + FBOstatus);

    mFBOWidth  = width;
    mFBOHeight = height;
}
 
开发者ID:ahmetozlu,项目名称:real_time_circle_detection_android,代码行数:36,代码来源:CameraGLRendererBase.java

示例9: _stopAnimacao

import android.util.Log; //导入方法依赖的package包/类
public static void _stopAnimacao() {
    try {
        if (mOUL != null) {
            mOUL.OnStopAnimation();
        }
    } catch (Exception localException) {
        Log.e(TAG, "_stopAnimacao ERROR: " + localException.getMessage());
    }
}
 
开发者ID:Hand-Talk,项目名称:android-library,代码行数:10,代码来源:CallbackInterface.java

示例10: onCreate

import android.util.Log; //导入方法依赖的package包/类
@Override
public void onCreate() {
    Log.v(TAG, "Create and prepare");
    String dataDir = this.getApplicationInfo().dataDir;
    prepareNode(this, dataDir);
    File bundleTar = prepareBundle(this, dataDir);
    try {
        unTar(bundleTar, new File(dataDir + "/" + APP_NAME));
    } catch (Exception e) {
        Log.e(TAG, "Cannot uncompress the background app bundle", e);
    }
}
 
开发者ID:staltz,项目名称:react-native-node,代码行数:13,代码来源:RNNodeService.java

示例11: getWeekDate

import android.util.Log; //导入方法依赖的package包/类
/**
 * Gets the input date is a few weeks
 *
 * @param date date
 * @return days of the week
 */
public static String getWeekDate(String date) {
    try {
        Date d = mDataFormat.parse(date);
        return getWeekDate(d);
    } catch (ParseException e) {
        e.printStackTrace();
        Log.e(TAG, e.getMessage());
    }
    return "The weeks are unknown.";
}
 
开发者ID:Jusenr,项目名称:androidtools,代码行数:17,代码来源:DateUtils.java

示例12: lockFocus

import android.util.Log; //导入方法依赖的package包/类
/**
 * Locks the focus as the first step for a still image capture.
 */
private void lockFocus() {
    mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER,
            CaptureRequest.CONTROL_AF_TRIGGER_START);
    try {
        mCaptureCallback.setState(PictureCaptureCallback.STATE_LOCKING);
        mCaptureSession.capture(mPreviewRequestBuilder.build(), mCaptureCallback, null);
    } catch (CameraAccessException e) {
        Log.e(TAG, "Failed to lock focus.", e);
    }
}
 
开发者ID:vshkl,项目名称:PXLSRT,代码行数:14,代码来源:Camera2.java

示例13: sendBackupData

import android.util.Log; //导入方法依赖的package包/类
@Override
public int sendBackupData(int numBytes) {

    if (backupState == null) {
        Log.e(TAG, "Attempted sendBackupData() before performFullBackup()");
        return TRANSPORT_ERROR;
    }

    long bytesTransferred = backupState.getBytesTransferred() + numBytes;

    if (bytesTransferred > configuration.getBackupSizeQuota()) {
        return TRANSPORT_QUOTA_EXCEEDED;
    }

    InputStream inputStream = backupState.getInputStream();
    ZipOutputStream outputStream = backupState.getOutputStream();

    try {
        outputStream.write(IOUtils.readFully(inputStream, numBytes, true));
        backupState.setBytesTransferred(bytesTransferred);

    } catch (IOException ex) {
        Log.e(TAG, "Error handling backup data for " + backupState.getPackageName() + ": ", ex);
        return TRANSPORT_ERROR;
    }
    return TRANSPORT_OK;
}
 
开发者ID:stevesoltys,项目名称:backup,代码行数:28,代码来源:ContentProviderBackupComponent.java

示例14: putBump

import android.util.Log; //导入方法依赖的package包/类
public long putBump(final BumpModel data) {
    long insertId = -1;
    SQLiteDatabase db = getDatabase();
    try {
        db.beginTransaction();
        final ContentValues values = getContentValues(data);
        insertId = db.insert(DataBaseHelper.TABLE_BUMPS, null, values);
        db.setTransactionSuccessful();
    } catch (Exception e) {
        Log.e(TAG, e != null && e.getMessage() != null ? e.getMessage() : "");
    } finally {
        db.endTransaction();
    }
    return insertId;
}
 
开发者ID:WorldBank-Transport,项目名称:RoadLab-Pro,代码行数:16,代码来源:BumpDAO.java

示例15: unBindViewHolder

import android.util.Log; //导入方法依赖的package包/类
/**
 * is called in onViewRecycled to unbind the data on the ViewHolder
 *
 * @param viewHolder the viewHolder for the type at this position
 * @param position   the position of this viewHolder
 */
@Override
public void unBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) {
    IItem item = (IItem) viewHolder.itemView.getTag();
    if (item != null) {
        item.unbindView(viewHolder);
    } else {
        Log.e("FastAdapter", "The bindView method of this item should set the `Tag` on its itemView (https://github.com/mikepenz/FastAdapter/blob/develop/library-core/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.java#L189)");
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:FastAdapter.java


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