當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。