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


Java Log.i方法代码示例

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


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

示例1: onSuccess

import android.util.Log; //导入方法依赖的package包/类
@Override
public void onSuccess(boolean isTop, GankBean data) {
    Log.i(TAG, "onSuccess: ----------------------------------");
    if (isTop) {
        mView.setRefreshData(data);
    } else {
        mView.setMoreGankData(data);
    }
    Observable.timer(2, TimeUnit.SECONDS)
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(new Action1<Long>() {
                @Override
                public void call(Long aLong) {
                    mView.hideLoading();
                }
            });
}
 
开发者ID:lueans,项目名称:LueansRead,代码行数:18,代码来源:GankPresenterImpl.java

示例2: measure

import android.util.Log; //导入方法依赖的package包/类
public void measure() {
    if (!mIsInitialized) {
        init();
        mIsInitialized = true;
    } else {
        mFramesCouner++;
        if (mFramesCouner % STEP == 0) {
            long time = Core.getTickCount();
            double fps = STEP * mFrequency / (time - mprevFrameTime);
            mprevFrameTime = time;
            if (mWidth != 0 && mHeight != 0)
                mStrfps = FPS_FORMAT.format(fps) + " [email protected]" + Integer.valueOf(mWidth) + "x" + Integer.valueOf(mHeight);
            else
                mStrfps = FPS_FORMAT.format(fps) + " FPS";
            Log.i(TAG, mStrfps);
        }
    }
}
 
开发者ID:hollaus,项目名称:TinyPlanetMaker,代码行数:19,代码来源:FpsMeter.java

示例3: onSingleTapUp

import android.util.Log; //导入方法依赖的package包/类
@Override
public boolean onSingleTapUp(MotionEvent e) {
    Log.i(TAG, "onSingleTapUp X:" + e.getX() + ",Y:" + e.getY());

    if (mIsReady && focus) {
        setFocusAreaIndicator();
        try {
            mMediaStreamingManager.doSingleTapUp((int) e.getX(), (int) e.getY());
        } catch (Exception ex) {
            Log.e(TAG, ex.getMessage());
        }

        return true;
    }
    return false;
}
 
开发者ID:2534290808,项目名称:react-native-pili-live,代码行数:17,代码来源:PiliStreamingViewManager.java

示例4: onSharedPreferenceChanged

import android.util.Log; //导入方法依赖的package包/类
@Override
public void onSharedPreferenceChanged(SharedPreferences prefs, String name) {
    Log.i(TAG, "Preference " + name + "=" + prefs.getAll().get(name));
    if ("log".equals(name)) {
        // Get enabled
        boolean log = prefs.getBoolean(name, false);

        // Display disabled warning
        TextView tvDisabled = (TextView) findViewById(R.id.tvDisabled);
        tvDisabled.setVisibility(log ? View.GONE : View.VISIBLE);

        // Check switch state
        SwitchCompat swEnabled = (SwitchCompat) getSupportActionBar().getCustomView().findViewById(R.id.swEnabled);
        if (swEnabled.isChecked() != log)
            swEnabled.setChecked(log);

        ServiceSinkhole.reload("changed " + name, ActivityLog.this);
    }
}
 
开发者ID:miankai,项目名称:MKAPP,代码行数:20,代码来源:ActivityLog.java

示例5: dealDotZero

import android.util.Log; //导入方法依赖的package包/类
private static String dealDotZero(BigDecimal bd) {
    String origString = bd + "";
    Log.i("fornia", "check size origString:" + origString);
    String result = origString;
    if (origString.indexOf(".") > 0) {
        return origString.replaceAll("0+?$", "").replaceAll("[.]$", "");
    }
    return result;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:10,代码来源:LetvUtils.java

示例6: processUnknownUuid

import android.util.Log; //导入方法依赖的package包/类
public void processUnknownUuid(String incomingUuid, byte[] incomingValue) {
    StringBuilder sb = new StringBuilder();
    for (byte b : incomingValue) {
        sb.append(String.format("%02x", b));
    }
    //this.unknownUUID.set(c_uuid);
    //this.unknownValue.set("hex:" + sb.toString() + " (" + Integer.toString(unsignedShort(c_value)) + ")");
    EventBus.getDefault().post(new DeviceStatusEvent("UNKNOWN " + incomingUuid + ":" +
            "hex:" + sb.toString() + " (" + Integer.toString(unsignedShort(incomingValue)) + ")"));
    Log.i(TAG, "UNKNOWN Device characteristic:" + incomingUuid + " value=" + sb.toString() + "|" + Integer.toString(unsignedShort(incomingValue)));
}
 
开发者ID:ponewheel,项目名称:android-ponewheel,代码行数:12,代码来源:OWDevice.java

示例7: onRemoteViewDestroyed

import android.util.Log; //导入方法依赖的package包/类
@Override
public void onRemoteViewDestroyed(OTWrapper otWrapper, View remoteView, String remoteId) throws ListenerException {
    Log.i(LOG_TAG, "Remote view is destroyed");
    if (remoteId == mScreenRemoteId) {
        mScreenRemoteId = null;
        removeRemoteScreenSharing();
    } else {
        removeParticipant(Participant.Type.REMOTE, remoteId);
    }
}
 
开发者ID:opentok,项目名称:accelerator-sample-apps-android,代码行数:11,代码来源:MainActivity.java

示例8: onShowNewsCommandRecognized

import android.util.Log; //导入方法依赖的package包/类
/**
 * Metoda wywoływana kiedy rozpoznana zostanie komenda pokazania widżetu wiadomości.
 * Pokazuje widżet.
 */
@Override
public void onShowNewsCommandRecognized() {
    Log.i(TAG, "Text command interpreter recognized show all news command.");
    callPolsatNews();
    callTvnNews();
}
 
开发者ID:hypeapps,项目名称:black-mirror,代码行数:11,代码来源:HomePresenter.java

示例9: extract

import android.util.Log; //导入方法依赖的package包/类
private static void extract(ZipFile apk, ZipEntry dexFile, File extractTo, String extractedFilePrefix) throws IOException, FileNotFoundException {
    Throwable th;
    InputStream in = apk.getInputStream(dexFile);
    File tmp = File.createTempFile(extractedFilePrefix, EXTRACTED_SUFFIX, extractTo.getParentFile());
    Log.i(TAG, "Extracting " + tmp.getPath());
    try {
        ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(tmp)));
        try {
            ZipEntry classesDex = new ZipEntry("classes.dex");
            classesDex.setTime(dexFile.getTime());
            out.putNextEntry(classesDex);
            byte[] buffer = new byte[16384];
            for (int length = in.read(buffer); length != -1; length = in.read(buffer)) {
                out.write(buffer, 0, length);
            }
            out.closeEntry();
            out.close();
            Log.i(TAG, "Renaming to " + extractTo.getPath());
            if (tmp.renameTo(extractTo)) {
                closeQuietly(in);
                tmp.delete();
                return;
            }
            throw new IOException("Failed to rename \"" + tmp.getAbsolutePath() + "\" to \"" + extractTo.getAbsolutePath() + a.e);
        } catch (Throwable th2) {
            th = th2;
            ZipOutputStream zipOutputStream = out;
            closeQuietly(in);
            tmp.delete();
            throw th;
        }
    } catch (Throwable th3) {
        th = th3;
        closeQuietly(in);
        tmp.delete();
        throw th;
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:39,代码来源:MultiDexExtractor.java

示例10: initializeMqttClient

import android.util.Log; //导入方法依赖的package包/类
private void initializeMqttClient()
    throws MqttException, IOException, NoSuchAlgorithmException, InvalidKeySpecException {

    mqttClient = new MqttClient(mMqttOptions.getBrokerUrl(),
            mMqttOptions.getClientId(), new MemoryPersistence());

    MqttConnectOptions options = new MqttConnectOptions();
    // Note that the the Google Cloud IoT only supports MQTT 3.1.1, and Paho requires that we
    // explicitly set this. If you don't set MQTT version, the server will immediately close its
    // connection to your device.
    options.setMqttVersion(MqttConnectOptions.MQTT_VERSION_3_1_1);
    options.setUserName(CloudIotCoreOptions.UNUSED_ACCOUNT_NAME);
    options.setAutomaticReconnect(true);

    // generate the jwt password
    options.setPassword(mqttAuth.createJwt(mMqttOptions.getProjectId()));

    mqttClient.setCallback(this);
    mqttClient.connect(options);

    if(mqttClient.isConnected()) {
        try{
            mSubTopic = "/devices/sense_hub_2.0_android_things/config";// + NetworkUtils.getMACAddress(mContext);
            Log.i(TAG, "initializeMqttClient subscribe topic=" + mSubTopic);
            mqttClient.subscribe(mSubTopic, 1);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    mReady.set(true);
}
 
开发者ID:dmtan90,项目名称:Sense-Hub-Android-Things,代码行数:32,代码来源:MqttIoTPublisher.java

示例11: downloadFile

import android.util.Log; //导入方法依赖的package包/类
private File downloadFile(String url, String localeFileName) {
    final File outputFile = new File(KeyboardService.imagesDir, localeFileName);
    if (outputFile.exists()) {
        return outputFile;
    }
    try {
        InputStream resourceReader = (InputStream) new URL(url).getContent();
        final byte[] buffer = new byte[4096];
        OutputStream dataWriter = new FileOutputStream(outputFile);
        try {
            while (true) {
                final int numRead = resourceReader.read(buffer);
                if (numRead <= 0) {
                    break;
                }
                dataWriter.write(buffer, 0, numRead);
            }
            if (outputFile.length() > 0) {
                Log.i(TAG, "load file: " + outputFile.getName() + ": " + outputFile.length() + " bytes");
                return outputFile;
            } else {
                outputFile.delete();
                return null;
            }
        } finally {
            if (dataWriter != null) {
                dataWriter.flush();
                dataWriter.close();
            }
            if (resourceReader != null) {
                resourceReader.close();
            }
        }

    } catch (IOException e) {
        e.printStackTrace();
        return null;
    }
}
 
开发者ID:ROKOLabs,项目名称:ROKOmoji.Emoji.Keyboard.App-Android,代码行数:40,代码来源:Stickers.java

示例12: addSongsNext

import android.util.Log; //导入方法依赖的package包/类
public void addSongsNext(int[] Id) {
	String str = "";
	for(int i = 0;i < Id.length;i++){
		Log.i("My","ADD NEXT : " + Id[i]) ;
		str += MediaStore.Audio.Media._ID + " = " + Id[i];
		if(Id.length-1 != i){
			str += " OR ";
		}
	}

	String[] projection = {MediaStore.Audio.Media.TITLE,MediaStore.Audio.Media._ID,MediaStore.Audio.Media.DURATION};
	Cursor DataCursor = Gh.getContentResolver().query(
			MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, projection,
			str, null, MediaStore.Audio.Media.TITLE +" COLLATE NOCASE ASC ");
	int from = PID + 1;
	if(PID == 0  || PID == -1){
		from = list.size();
	}
	while (DataCursor.moveToNext()) {
		list.add(from,new String[] {DataCursor.getString(0),DataCursor.getString(1),DataCursor.getString(2),""});
		from++;
	}

	DataCursor.close();

	mEvent.trigger(playerEvents.SONGS_ADDED);

	playlist.save(list, playlist.listName);
}
 
开发者ID:KishanV,项目名称:Android-Music-Player,代码行数:30,代码来源:musicHandler.java

示例13: sendCrawlRequest

import android.util.Log; //导入方法依赖的package包/类
/**
 * Send a crawl request to the peer.
 * @param peer The peer.
 * @param publicKey Public key of me.
 * @param seqNum Requested sequence number.
 */
public void sendCrawlRequest(Peer peer, byte[] publicKey, int seqNum) {
    int sq = seqNum;
    if (seqNum == 0) {
        MessageProto.TrustChainBlock block = dbHelper.getBlock(publicKey,
                dbHelper.getMaxSeqNum(publicKey));
        if (block != null) {
            sq = block.getSequenceNumber();
        } else {
            sq = GENESIS_SEQ;
        }
    }

    if (sq >= 0) {
        sq = Math.max(GENESIS_SEQ, sq);
    }

    Log.i(TAG, "Requesting crawl of node " + bytesToHex(publicKey) + ":" + sq);

    MessageProto.CrawlRequest crawlRequest =
            MessageProto.CrawlRequest.newBuilder()
                    .setPublicKey(ByteString.copyFrom(getMyPublicKey()))
                    .setRequestedSequenceNumber(sq)
                    .setLimit(100).build();

    // send the crawl request
    MessageProto.Message message = newBuilder().setCrawlRequest(crawlRequest).build();

    listener.updateLog("Sending crawl request to " + peer.getName() + "\n");
    sendMessage(peer, message);
}
 
开发者ID:wkmeijer,项目名称:CS4160-trustchain-android,代码行数:37,代码来源:Communication.java

示例14: endAnimations

import android.util.Log; //导入方法依赖的package包/类
@Override
public void endAnimations() {
    Log.i(TAG, "endAnimations");
}
 
开发者ID:googlesamples,项目名称:android-fido,代码行数:5,代码来源:CustomItemAnimator.java

示例15: checkActiveView

import android.util.Log; //导入方法依赖的package包/类
private void checkActiveView() {
    if (fajrDate == null || sunriseDate == null || duhrDate == null || asrDate == null || maghrebDate == null || ishaDate == null) return;
    removeActiveViews();
    Date current = Calendar.getInstance().getTime();



    if (current.after(fajrDate) && current.before(sunriseDate)){
        pray2.setBackgroundColor(Color.argb(255, 73, 138, 127));
        nextPray = getString(R.string.sunrise);
        lastDate = fajrDate;
        nextDate = sunriseDate;
    }else if (current.after(sunriseDate) && current.before(duhrDate)){
        pray3.setBackgroundColor(Color.argb(255, 73, 138, 127));
        nextPray = getString(R.string.zuhr);
        lastDate = sunriseDate;
        nextDate = duhrDate;
    }else if (current.after(duhrDate) && current.before(asrDate)){
        pray4.setBackgroundColor(Color.argb(255, 73, 138, 127));
        nextPray = getString(R.string.asr);
        lastDate = duhrDate;
        nextDate = asrDate;
    }else if (current.after(asrDate) && current.before(maghrebDate)){
        pray5.setBackgroundColor(Color.argb(255, 73, 138, 127));
        nextPray = getString(R.string.magrib);
        lastDate = asrDate;
        nextDate = maghrebDate;
    }else if (current.after(maghrebDate) && current.before(ishaDate)){
        pray6.setBackgroundColor(Color.argb(255, 73, 138, 127));
        nextPray = getString(R.string.isha);
        lastDate = maghrebDate;
        nextDate = ishaDate;
    }else {

        if (current.after(midNightDate) && current.before(fajrDate)){
            lastDate = getPrayerforPreviousDay().get()[5];
            nextDate = fajrDate;
        }else {

            lastDate = ishaDate;
            nextDate = getPrayerforNextDay().get()[0];
        }
        pray1.setBackgroundColor(Color.argb(255, 73, 138, 127));
        nextPray = getString(R.string.fajr);


    }

    salahNow.setText(NumbersLocal.convertNumberType(getContext(), nextPray + " " + format.format(nextDate)));


    Log.i("DATE_TAg" ,"last : "+format.format(lastDate));
    Log.i("DATE_TAg" ,"current : "+format.format(current));
    Log.i("DATE_TAg" ,"end : "+format.format(nextDate));



    updateTimer(current);

}
 
开发者ID:fekracomputers,项目名称:MuslimMateAndroid,代码行数:61,代码来源:PrayingFragment.java


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