本文整理汇总了Java中android.util.Log.w方法的典型用法代码示例。如果您正苦于以下问题:Java Log.w方法的具体用法?Java Log.w怎么用?Java Log.w使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.util.Log
的用法示例。
在下文中一共展示了Log.w方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.util.Log; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
NetworkingUtility.registerListener(this);
disablePlayButtons();
mGoogleSignInClient = GoogleSignIn.getClient(this, GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN);
if (!BaseGameUtils.verifySampleSetup(this, R.string.app_id)) {
Log.w("SIGNIN", "*** Warning: setup problems detected. Sign in may not work!");
}
// start the sign-in flow
Log.d("SIGNIN", "Sign-in button clicked");
startActivityForResult(mGoogleSignInClient.getSignInIntent(), RC_SIGN_IN);
LanguageManager.languageManagement(this);
}
示例2: handleAnswerCall
import android.util.Log; //导入方法依赖的package包/类
private void handleAnswerCall(Intent intent) {
if (callState != CallState.STATE_LOCAL_RINGING) {
Log.w(TAG, "Can only answer from ringing!");
return;
}
if (peerConnection == null || dataChannel == null || recipient == null || callId == null) {
throw new AssertionError("assert");
}
DatabaseFactory.getSmsDatabase(this).insertReceivedCall(recipient.getNumber());
this.peerConnection.setAudioEnabled(true);
this.peerConnection.setVideoEnabled(true);
this.dataChannel.send(new DataChannel.Buffer(ByteBuffer.wrap(Data.newBuilder().setConnected(Connected.newBuilder().setId(this.callId)).build().toByteArray()), false));
intent.putExtra(EXTRA_CALL_ID, callId);
intent.putExtra(EXTRA_REMOTE_NUMBER, recipient.getNumber());
handleCallConnected(intent);
}
示例3: log
import android.util.Log; //导入方法依赖的package包/类
@Override
public void log(int level, String key, String value) {
switch (level){
case DEBUG:
Log.d(key,value);
break;
case INFO:
Log.i(key,value);
break;
case ERROR:
Log.e(key,value);
break;
default:
Log.w(key,value);
break;
}
}
示例4: onTouchEvent
import android.util.Log; //导入方法依赖的package包/类
@Override
public boolean onTouchEvent(MotionEvent event)
{
try
{
if ((mediaPlayer != null) && (mediaController != null) && (isPrepared == true))
{
mediaController.show();
return true;
}
else
{
return false;
}
}
catch (Exception e)
{
Log.w("Replayer", "onTouchEvent : " + getApplicationContext().getString(R.string.log_replayer_echec_touch_event) + " : " + e);
databaseManager.insertLog(getApplicationContext(), "" + getApplicationContext().getString(R.string.log_replayer_echec_touch_event), new Date().getTime(), 2, false);
return false;
}
}
示例5: parseIntent
import android.util.Log; //导入方法依赖的package包/类
@Override
protected Intent parseIntent(XmlResourceParser parser) {
String uri = null;
try {
uri = getAttributeValue(parser, ATTR_URI);
return Intent.parseUri(uri, 0);
} catch (URISyntaxException e) {
Log.w(TAG, "Shortcut has malformed uri: " + uri);
return null; // Oh well
}
}
示例6: calculateInternal
import android.util.Log; //导入方法依赖的package包/类
private <T> T calculateInternal(final Function<IMainService, ? extends T> function) {
if (mMainProcess) {
return function.call(mMainApis);
} else {
if (mState == STATE_DISCONNECTED) {
Log.w(TAG, HERMES_SERVICE_DISCONNECTED);
return null;
} else {
return mRemoteApis.calculate(new Function<IMainService, T>() {
@Override
public T call(IMainService o) {
return function.call(o);
}
});
}
}
}
示例7: open
import android.util.Log; //导入方法依赖的package包/类
/**
* Opens a rear-facing camera with {@link Camera#open(int)}, if one exists, or opens camera 0.
*/
@Override
public Camera open() {
int numCameras = Camera.getNumberOfCameras();
if (numCameras == 0) {
Log.w(TAG, "No cameras!");
return null;
}
int index = 0;
while (index < numCameras) {
Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
Camera.getCameraInfo(index, cameraInfo);
if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK) {
break;
}
index++;
}
Camera camera;
if (index < numCameras) {
Log.i(TAG, "Opening camera #" + index);
camera = Camera.open(index);
} else {
Log.i(TAG, "No camera facing back; returning camera #0");
camera = Camera.open(0);
}
return camera;
}
示例8: getUserInfo
import android.util.Log; //导入方法依赖的package包/类
/**
* Returns the UserInfo object describing a specific user.
* @param handle the user handle of the user whose information is being requested.
* @return the UserInfo object for a specific user.
* @hide
*/
public VUserInfo getUserInfo(int handle) {
try {
return mService.getUserInfo(handle);
} catch (RemoteException re) {
Log.w(TAG, "Could not get user info", re);
return null;
}
}
示例9: onResume
import android.util.Log; //导入方法依赖的package包/类
@Override
public void onResume() {
Log.w(TAG, "onResume()");
super.onResume();
if (!networkAccess.isCensored(this)) MessageRetrievalService.registerActivityStarted(this);
initializeScreenshotSecurity();
EventBus.getDefault().register(this);
}
示例10: onReceive
import android.util.Log; //导入方法依赖的package包/类
@Override
public synchronized void onReceive(Context context, Intent intent) {
Log.w(TAG, "onReceive()");
if (!action.equals(intent.getAction())) {
Log.w(TAG, "received broadcast with unexpected action " + intent.getAction());
return;
}
onResult(context, intent);
resultAvailable = true;
notifyAll();
}
示例11: w
import android.util.Log; //导入方法依赖的package包/类
/**
* W.
*
* @param text the text
*/
public static void w(String text)
{
if (W)
{
if ( UseExternalLogger )
{
//Microlog4android.info(text);
}
Log.w(TAG, text);
}
}
示例12: onBackPressedOnKeyboard
import android.util.Log; //导入方法依赖的package包/类
private void onBackPressedOnKeyboard() {
Log.d("SoftKeyboardListener", "onBackPressedOnKeyboard");
View focusedView = findFocusedView();
if (focusedView == null) {
Log.w("SoftKeyboardListener", "wut focusedView==null? how is this possible?");
return;
}
setImeVisibility(false);
mDefaultFocusView.requestFocus();
}
示例13: onResult
import android.util.Log; //导入方法依赖的package包/类
@TargetApi(VERSION_CODES.LOLLIPOP)
@Override
public synchronized void onResult(Context context, Intent intent) {
if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP_MR1) {
Log.w(TAG, "HTTP status: " + intent.getIntExtra(SmsManager.EXTRA_MMS_HTTP_STATUS, -1));
}
Log.w(TAG, "code: " + getResultCode() + ", result string: " + getResultData());
}
示例14: parseHeader
import android.util.Log; //导入方法依赖的package包/类
private boolean parseHeader() {
// Note: see ISO/IEC 13818-1, section 2.4.3.6 for detailed information on the format of
// the header.
pesScratch.setPosition(0);
int startCodePrefix = pesScratch.readBits(24);
if (startCodePrefix != 0x000001) {
Log.w(TAG, "Unexpected start code prefix: " + startCodePrefix);
payloadSize = -1;
return false;
}
pesScratch.skipBits(8); // stream_id.
int packetLength = pesScratch.readBits(16);
pesScratch.skipBits(5); // '10' (2), PES_scrambling_control (2), PES_priority (1)
dataAlignmentIndicator = pesScratch.readBit();
pesScratch.skipBits(2); // copyright (1), original_or_copy (1)
ptsFlag = pesScratch.readBit();
dtsFlag = pesScratch.readBit();
// ESCR_flag (1), ES_rate_flag (1), DSM_trick_mode_flag (1),
// additional_copy_info_flag (1), PES_CRC_flag (1), PES_extension_flag (1)
pesScratch.skipBits(6);
extendedHeaderLength = pesScratch.readBits(8);
if (packetLength == 0) {
payloadSize = -1;
} else {
payloadSize = packetLength + 6 /* packetLength does not include the first 6 bytes */
- HEADER_SIZE - extendedHeaderLength;
}
return true;
}
示例15: onRun
import android.util.Log; //导入方法依赖的package包/类
@Override
public void onRun() {
if (data == null) {
Log.w(TAG, "Received NULL pdu, ignoring...");
return;
}
PduParser parser = new PduParser(data);
GenericPdu pdu = null;
try {
pdu = parser.parse();
} catch (RuntimeException e) {
Log.w(TAG, e);
}
if (isNotification(pdu) && !isBlocked(pdu)) {
MmsDatabase database = DatabaseFactory.getMmsDatabase(context);
Pair<Long, Long> messageAndThreadId = database.insertMessageInbox((NotificationInd)pdu, subscriptionId);
Log.w(TAG, "Inserted received MMS notification...");
ApplicationContext.getInstance(context)
.getJobManager()
.add(new MmsDownloadJob(context,
messageAndThreadId.first,
messageAndThreadId.second,
true));
} else if (isNotification(pdu)) {
Log.w(TAG, "*** Received blocked MMS, ignoring...");
}
}