本文整理汇总了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();
}
});
}
示例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);
}
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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)));
}
示例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);
}
}
示例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();
}
示例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;
}
}
示例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);
}
示例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;
}
}
示例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);
}
示例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);
}
示例14: endAnimations
import android.util.Log; //导入方法依赖的package包/类
@Override
public void endAnimations() {
Log.i(TAG, "endAnimations");
}
示例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);
}