21-03-17== 和 equals()

Java中==与equals的区别
本文详细解析了Java中==运算符与equals方法的区别及应用。==用于比较基本数据类型和引用类型的地址值,而equals则用于比较对象的内容是否相同。文章还提供了重写equals方法的示例。

== 和 equals()

  • ==:运算符

    1. 可以使用在基本数据类型变量和引用数据类型变量中

    2. 如果比较的是基本数据类型变量:比较两个变量保存的数据是否相等。(不一定数据类型相同,如double和int也可以比较)

      如果比较大的是引用数据类型变量:比较两个对象的地址值是否相同,即两个引用是否指向同一个对象实体。

    3. == 符号使用时,必须保证符号左右两边的变量类型一致。

  • equals()

    1. 是一个方法,而非运算符

    2. 只能适用于引用数据变量 a.equals(b)

    3. Object类中equals()的定义:

      public boolean equals(Object obj){
      
      			return (this == obj);
      
      }
      

      说明:Object类中定义的equals()和==的作用是相同的:比较两个对象的地址值是否相同

    4. 像String、Date、File、包装类等都重写了Objiect类中的equals()方法。重写以后,比较的不是两个引用的地址地址是否相同,而是比较两个对象的"实体内容"是否相同。

    5. 通常情况下,我们自定义的类型如果使用equals()的话,即比较实体内容是否相同,那么,我们就需要对Object类中的equals()进行重写

  • 重写实例

package 多态性测试.Equals的重写;

public class Order {
	int orderld;
	String orderName;
	

	public Order(int orderld, String orderName){
		this.orderld = orderld;
		this.orderName = orderName;
	}
	
	public boolean equals(Object obj){
		if(this == obj ){
			return true;
		}
		if(obj instanceof Order){
			Order or = (Order)obj;
			return this.orderld == or.orderld && this.orderName.equals(or.orderName);
		}
		return false;
	}
}
package 多态性测试.Equals的重写;

public class OrderEqualsTest {
	public static void main(String[] args) {
		Order or1 = new Order(24, "customer");
		Order or2 = new Order(24, new String("customer"));
		System.out.println(or1.equals(or2));
	}
}
2025-09-03 20:41:06.091 718-744 AppHibernationService system_server E Package com.example.myapplication is not installed for user 0 2025-09-03 20:41:06.091 718-744 AppHibernationService system_server E Package com.example.myapplication is not installed for any user 2025-09-03 20:41:06.091 718-744 AppHibernationService system_server E Package com.example.myapplication is not installed for user 0 2025-09-03 20:41:06.091 718-744 AppHibernationService system_server E Package com.example.myapplication is not installed for any user 2025-09-03 20:54:02.033 718-858 InputDispatcher system_server E channel '6a720b8 com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-03 21:00:20.868 718-858 InputDispatcher system_server E channel '207de1e com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-03 21:05:38.221 718-858 InputDispatcher system_server E channel 'c1f632b com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-07 20:44:52.229 1830-1942 .apps.wellbeing com.google.android.apps.wellbeing E Failed to open APK '/data/app/~~dJ88ZxVdANwbzdqaLfO8BA==/com.example.myapplication-Oci8KYGLbCHl-jUio4U6EQ==/base.apk': I/O error 2025-09-07 20:44:52.232 1830-1942 .apps.wellbeing com.google.android.apps.wellbeing E Failed to open APK '/data/app/~~dJ88ZxVdANwbzdqaLfO8BA==/com.example.myapplication-Oci8KYGLbCHl-jUio4U6EQ==/base.apk': I/O error 2025-09-07 20:44:52.232 1830-1942 ResourcesManager com.google.android.apps.wellbeing E failed to add asset path '/data/app/~~dJ88ZxVdANwbzdqaLfO8BA==/com.example.myapplication-Oci8KYGLbCHl-jUio4U6EQ==/base.apk' java.io.IOException: Failed to load asset path /data/app/~~dJ88ZxVdANwbzdqaLfO8BA==/com.example.myapplication-Oci8KYGLbCHl-jUio4U6EQ==/base.apk at android.content.res.ApkAssets.nativeLoad(Native Method) at android.content.res.ApkAssets.<init>(ApkAssets.java:322) at android.content.res.ApkAssets.loadFromPath(ApkAssets.java:171) at android.app.ResourcesManager.loadApkAssets(ResourcesManager.java:618) at android.app.ResourcesManager$ApkAssetsSupplier.load(ResourcesManager.java:287) at android.app.ResourcesManager.createAssetManager(ResourcesManager.java:714) at android.app.ResourcesManager.createResourcesImpl(ResourcesManager.java:801) at android.app.ResourcesManager.findOrCreateResourcesImplForKeyLocked(ResourcesManager.java:854) at android.app.ResourcesManager.createResources(ResourcesManager.java:1199) at android.app.ResourcesManager.getResources(ResourcesManager.java:1301) at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:2979) at android.app.ApplicationPackageManager.getResourcesForApplication(ApplicationPackageManager.java:2154) at android.app.ApplicationPackageManager.getResourcesForApplication(ApplicationPackageManager.java:2140) at android.app.ApplicationPackageManager.getText(ApplicationPackageManager.java:2481) at android.content.pm.PackageItemInfo.loadUnsafeLabel(PackageItemInfo.java:237) at android.content.pm.PackageItemInfo.loadLabel(PackageItemInfo.java:226) at android.app.ApplicationPackageManager.getApplicationLabel(ApplicationPackageManager.java:2526) at cut.c(PG:38) at cfv.apply(PG:391) at e$$ExternalSyntheticApiModelOutline1.m(D8$$SyntheticClass:47) at lcx.accept(PG:44) at j$.util.stream.M0.accept(SourceFile:3) at j$.util.D.x(SourceFile:24) at j$.util.T.forEachRemaining(SourceFile:24) at j$.util.stream.b.c(SourceFile:21) at j$.util.stream.b.y(SourceFile:8) at j$.util.stream.F.b(SourceFile:5) at j$.util.stream.b.f(SourceFile:35) at j$.util.stream.c1.collect(SourceFile:83) at bva.a(PG:99) at kbp.a(PG:301) at kbp.a(PG:38) at ltp.a(PG:3) at lsv.run(PG:19) at ltr.run(PG:5) at lrz.run(PG:17) at idd.run(PG:3) at loz.run(PG:50) at hsu.run(PG:768) at java.lang.Thread.run(Thread.java:1119) at ieo.run(PG:63) 2025-09-07 20:47:00.731 718-858 InputDispatcher system_server E channel 'd671972 com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-07 20:52:16.888 718-858 InputDispatcher system_server E channel '54ceef5 com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-10 08:19:19.039 718-858 InputDispatcher system_server E channel 'da9443c com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-10 08:28:44.520 718-858 InputDispatcher system_server E channel 'fb3dc4e com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-10 08:31:15.953 718-858 InputDispatcher system_server E channel '50c58e2 com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-10 09:08:31.738 718-1763 TransitionController system_server E Set visible without transition ActivityRecord{10540855 u0 com.example.myapplication/.MainActivity t25} playing=true caller=com.android.server.wm.TaskFragment.resumeTopActivity:1629 2025-09-10 09:46:26.507 718-858 InputDispatcher system_server E channel 'dc063cb com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-17 08:57:50.144 718-858 InputDispatcher system_server E channel '1f6629d com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-17 09:00:15.359 718-858 InputDispatcher system_server E channel 'b8ebe12 com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-17 09:08:43.780 718-858 InputDispatcher system_server E channel 'b3a4af9 com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-17 09:09:46.460 718-858 InputDispatcher system_server E channel 'e65939a com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-17 09:10:18.549 718-858 InputDispatcher system_server E channel '97c3cce com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-17 09:10:20.415 718-858 InputDispatcher system_server E channel '4a4890c com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-17 09:15:34.082 718-858 InputDispatcher system_server E channel '5112bb7 com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-17 09:20:13.015 718-858 InputDispatcher system_server E channel 'd3fcd81 com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-17 09:21:45.786 718-858 InputDispatcher system_server E channel '83178b7 com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-17 09:40:09.328 718-858 InputDispatcher system_server E channel 'b88d2d6 com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-22 17:06:13.033 13959-13959 TransactionExecutor pid-13959 E Failed to execute the transaction: tId:-782804407 ClientTransaction{ tId:-782804407 transactionItems=[ tId:-782804407 LaunchActivityItem{activityToken=android.os.BinderProxy@be43358,intent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 xflg=0x4 cmp=com.example.myapplication/.MainActivity },ident=184265485,info=ActivityInfo{a09354c com.example.myapplication.MainActivity},curConfig={1.0 310mcc260mnc [en_US] ldltr sw411dp w411dp h914dp 420dpi nrml long port finger qwerty/v/v dpad/v winConfig={ mBounds=Rect(0, 0 - 1080, 2400) mAppBounds=Rect(0, 0 - 1080, 2400) mMaxBounds=Rect(0, 0 - 1080, 2400) mDisplayRotation=ROTATION_0 mWindowingMode=fullscreen mActivityType=undefined mAlwaysOnTop=undefined mRotation=ROTATION_0} as.2 s.535 fontWeightAdjustment=0},overrideConfig={1.0 310mcc260mnc [en_US] ldltr sw411dp w411dp h914dp 420dpi nrml long port finger qwerty/v/v dpad/v winConfig={ mBounds=Rect(0, 0 - 1080, 2400) mAppBounds=Rect(0, 0 - 1080, 2400) mMaxBounds=Rect(0, 0 - 1080, 2400) mDisplayRotation=ROTATION_0 mWindowingMode=fullscreen mActivityType=standard mAlwaysOnTop=undefined mRotation=ROTATION_0} as.2 s.2 fontWeightAdjustment=0},deviceId=0,referrer=com.android.shell,procState=2,state=null,persistentState=null,pendingResults=null,pendingNewIntents=null,sceneTransitionInfo=null,profilerInfo=null,assistToken=android.os.BinderProxy@456b8d9,shareableActivityToken=android.os.BinderProxy@615029e,activityWindowInfo=ActivityWindowInfo{isEmbedded=false, taskBounds=Rect(0, 0 - 1080, 2400), taskFragmentBounds=Rect(0, 0 - 1080, 2400)}} tId:-782804407 ResumeActivityItem{mActivityToken=android.os.BinderProxy@be43358,procState=-1,isForward=true,shouldSendCompatFakeFocus=false} tId:-782804407 Target activity: com.example.myapplication.MainActivity tId:-782804407 ] tId:-782804407 } 2025-09-22 17:06:13.036 13959-13959 AndroidRuntime pid-13959 E FATAL EXCEPTION: main Process: com.example.myapplication, PID: 13959 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication/com.example.myapplication.MainActivity}: java.lang.ClassCastException: androidx.appcompat.widget.AppCompatImageButton cannot be cast to android.widget.Button at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4280) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4467) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:222) at android.app.servertransaction.TransactionExecutor.executeNonLifecycleItem(TransactionExecutor.java:133) at android.app.servertransaction.TransactionExecutor.executeTransactionItems(TransactionExecutor.java:103) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:80) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2823) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loopOnce(Looper.java:248) at android.os.Looper.loop(Looper.java:338) at android.app.ActivityThread.main(ActivityThread.java:9067) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:932) Caused by: java.lang.ClassCastException: androidx.appcompat.widget.AppCompatImageButton cannot be cast to android.widget.Button at com.example.myapplication.MainActivity.setButtonListeners(MainActivity.java:107) at com.example.myapplication.MainActivity.onCreate(MainActivity.java:28) at android.app.Activity.performCreate(Activity.java:9155) at android.app.Activity.performCreate(Activity.java:9133) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1521) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4262) ... 13 more 2025-09-22 17:08:39.215 14080-14080 TransactionExecutor pid-14080 E Failed to execute the transaction: tId:1940201582 ClientTransaction{ tId:1940201582 transactionItems=[ tId:1940201582 LaunchActivityItem{activityToken=android.os.BinderProxy@7091517,intent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 xflg=0x4 cmp=com.example.myapplication/.MainActivity },ident=36553713,info=ActivityInfo{8c6a69b com.example.myapplication.MainActivity},curConfig={1.0 310mcc260mnc [en_US] ldltr sw411dp w411dp h914dp 420dpi nrml long port finger qwerty/v/v dpad/v winConfig={ mBounds=Rect(0, 0 - 1080, 2400) mAppBounds=Rect(0, 0 - 1080, 2400) mMaxBounds=Rect(0, 0 - 1080, 2400) mDisplayRotation=ROTATION_0 mWindowingMode=fullscreen mActivityType=undefined mAlwaysOnTop=undefined mRotation=ROTATION_0} as.2 s.536 fontWeightAdjustment=0},overrideConfig={1.0 310mcc260mnc [en_US] ldltr sw411dp w411dp h914dp 420dpi nrml long port finger qwerty/v/v dpad/v winConfig={ mBounds=Rect(0, 0 - 1080, 2400) mAppBounds=Rect(0, 0 - 1080, 2400) mMaxBounds=Rect(0, 0 - 1080, 2400) mDisplayRotation=ROTATION_0 mWindowingMode=fullscreen mActivityType=standard mAlwaysOnTop=undefined mRotation=ROTATION_0} as.2 s.2 fontWeightAdjustment=0},deviceId=0,referrer=com.android.shell,procState=2,state=null,persistentState=null,pendingResults=null,pendingNewIntents=null,sceneTransitionInfo=null,profilerInfo=null,assistToken=android.os.BinderProxy@a09354c,shareableActivityToken=android.os.BinderProxy@8f10995,activityWindowInfo=ActivityWindowInfo{isEmbedded=false, taskBounds=Rect(0, 0 - 1080, 2400), taskFragmentBounds=Rect(0, 0 - 1080, 2400)}} tId:1940201582 ResumeActivityItem{mActivityToken=android.os.BinderProxy@7091517,procState=-1,isForward=true,shouldSendCompatFakeFocus=false} tId:1940201582 Target activity: com.example.myapplication.MainActivity tId:1940201582 ] tId:1940201582 } 2025-09-22 17:08:39.218 14080-14080 AndroidRuntime pid-14080 E FATAL EXCEPTION: main Process: com.example.myapplication, PID: 14080 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication/com.example.myapplication.MainActivity}: java.lang.ClassCastException: androidx.appcompat.widget.AppCompatImageButton cannot be cast to android.widget.Button at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4280) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4467) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:222) at android.app.servertransaction.TransactionExecutor.executeNonLifecycleItem(TransactionExecutor.java:133) at android.app.servertransaction.TransactionExecutor.executeTransactionItems(TransactionExecutor.java:103) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:80) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2823) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loopOnce(Looper.java:248) at android.os.Looper.loop(Looper.java:338) at android.app.ActivityThread.main(ActivityThread.java:9067) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:932) Caused by: java.lang.ClassCastException: androidx.appcompat.widget.AppCompatImageButton cannot be cast to android.widget.Button at com.example.myapplication.MainActivity.setButtonListeners(MainActivity.java:107) at com.example.myapplication.MainActivity.onCreate(MainActivity.java:28) at android.app.Activity.performCreate(Activity.java:9155) at android.app.Activity.performCreate(Activity.java:9133) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1521) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4262) ... 13 more 2025-09-22 17:16:44.788 14174-14174 AndroidRuntime pid-14174 E FATAL EXCEPTION: main Process: com.example.myapplication, PID: 14174 java.lang.ClassCastException: androidx.appcompat.widget.AppCompatImageButton cannot be cast to android.widget.TextView at com.example.myapplication.MainActivity.lambda$setButtonListeners$0$com-example-myapplication-MainActivity(MainActivity.java:41) at com.example.myapplication.MainActivity$$ExternalSyntheticLambda0.onClick(D8$$SyntheticClass:0) at android.view.View.performClick(View.java:8083) at android.view.View.performClickInternal(View.java:8060) at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0) at android.view.View$PerformClick.run(View.java:31549) at android.os.Handler.handleCallback(Handler.java:995) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loopOnce(Looper.java:248) at android.os.Looper.loop(Looper.java:338) at android.app.ActivityThread.main(ActivityThread.java:9067) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:932) 2025-09-22 17:16:44.809 718-858 InputDispatcher system_server E channel '15505d9 com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-22 17:23:26.582 718-858 InputDispatcher system_server E channel '7ce91bf com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-22 17:23:49.591 14368-14368 AndroidRuntime pid-14368 E FATAL EXCEPTION: main Process: com.example.myapplication, PID: 14368 java.lang.ClassCastException: androidx.appcompat.widget.AppCompatImageButton cannot be cast to android.widget.TextView at com.example.myapplication.MainActivity.lambda$setButtonListeners$0$com-example-myapplication-MainActivity(MainActivity.java:41) at com.example.myapplication.MainActivity$$ExternalSyntheticLambda0.onClick(D8$$SyntheticClass:0) at android.view.View.performClick(View.java:8083) at android.view.View.performClickInternal(View.java:8060) at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0) at android.view.View$PerformClick.run(View.java:31549) at android.os.Handler.handleCallback(Handler.java:995) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loopOnce(Looper.java:248) at android.os.Looper.loop(Looper.java:338) at android.app.ActivityThread.main(ActivityThread.java:9067) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:932) 2025-09-22 17:23:49.608 718-858 InputDispatcher system_server E channel '9cce75c com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-22 17:32:56.477 14730-14730 e.myapplication com.example.myapplication I Late-enabling -Xcheck:jni 2025-09-22 17:32:56.504 14730-14730 e.myapplication com.example.myapplication I Using CollectorTypeCMC GC. 2025-09-22 17:32:56.505 14730-14730 e.myapplication com.example.myapplication W Unexpected CPU variant for x86: x86_64. Known variants: atom, sandybridge, silvermont, goldmont, goldmont-plus, goldmont-without-sha-xsaves, tremont, kabylake, alderlake, default 2025-09-22 17:32:56.517 14730-14730 nativeloader com.example.myapplication D Load libframework-connectivity-tiramisu-jni.so using APEX ns com_android_tethering for caller /apex/com.android.tethering/javalib/framework-connectivity-t.jar: ok 2025-09-22 17:32:56.731 14730-14730 nativeloader com.example.myapplication D Configuring clns-9 for other apk /data/app/~~BU8Zpa-Ptb6zWCD1jUuDVQ==/com.example.myapplication-bvhvD7PKJdnssUQso6AYEw==/base.apk. target_sdk_version=36, uses_libraries=, library_path=/data/app/~~BU8Zpa-Ptb6zWCD1jUuDVQ==/com.example.myapplication-bvhvD7PKJdnssUQso6AYEw==/lib/x86_64:/data/app/~~BU8Zpa-Ptb6zWCD1jUuDVQ==/com.example.myapplication-bvhvD7PKJdnssUQso6AYEw==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.example.myapplication 2025-09-22 17:32:56.737 14730-14730 e.myapplication com.example.myapplication I AssetManager2(0x79d591a4c758) locale list changing from [] to [en-US] 2025-09-22 17:32:56.744 14730-14730 GraphicsEnvironment com.example.myapplication V Currently set values for: 2025-09-22 17:32:56.744 14730-14730 GraphicsEnvironment com.example.myapplication V angle_gl_driver_selection_pkgs=[] 2025-09-22 17:32:56.744 14730-14730 GraphicsEnvironment com.example.myapplication V angle_gl_driver_selection_values=[] 2025-09-22 17:32:56.744 14730-14730 GraphicsEnvironment com.example.myapplication V com.example.myapplication is not listed in per-application setting 2025-09-22 17:32:56.744 14730-14730 GraphicsEnvironment com.example.myapplication V ANGLE allowlist from config: com.dreamgames.royalmatch com.dts.freefiremax com.dxx.firenow com.gramgames.mergedragons com.ludo.king com.mojang.minecraftpe com.my.defense com.nintendo.zaka com.os.airforce com.playrix.fishdomdd.gplay io.teslatech.callbreak jp.konami.prospia net.peakgames.toonblast 2025-09-22 17:32:56.744 14730-14730 GraphicsEnvironment com.example.myapplication V com.example.myapplication is not listed in ANGLE allowlist or settings, returning default 2025-09-22 17:32:56.745 14730-14730 GraphicsEnvironment com.example.myapplication V Neither updatable production driver nor prerelease driver is supported. 2025-09-22 17:32:56.799 14730-14766 DisplayManager com.example.myapplication I Choreographer implicitly registered for the refresh rate. 2025-09-22 17:32:56.802 14730-14730 e.myapplication com.example.myapplication I AssetManager2(0x79d591a488d8) locale list changing from [] to [en-US] 2025-09-22 17:32:56.834 14730-14766 EGL_emulation com.example.myapplication I Opening libGLESv1_CM_emulation.so 2025-09-22 17:32:56.835 14730-14766 EGL_emulation com.example.myapplication I Opening libGLESv2_emulation.so 2025-09-22 17:32:56.841 14730-14766 HWUI com.example.myapplication W Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... 2025-09-22 17:32:56.841 14730-14766 HWUI com.example.myapplication W Failed to initialize 101010-2 format, error = EGL_SUCCESS 2025-09-22 17:32:56.881 14730-14730 AppCompatDelegate com.example.myapplication D Checking for metadata for AppLocalesMetadataHolderService : Service not found 2025-09-22 17:32:56.883 14730-14730 e.myapplication com.example.myapplication I AssetManager2(0x79d591a4f638) locale list changing from [] to [en-US] 2025-09-22 17:32:56.894 14730-14730 ashmem com.example.myapplication E Pinning is deprecated since Android Q. Please use trim or other methods. 2025-09-22 17:32:56.978 14730-14730 e.myapplication com.example.myapplication I hiddenapi: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (runtime_flags=0, domain=platform, api=unsupported) from Landroidx/appcompat/widget/ViewUtils; (domain=app) using reflection: allowed 2025-09-22 17:32:57.083 14730-14730 CompatChangeReporter com.example.myapplication D Compat change id reported: 377864165; UID 10217; state: ENABLED 2025-09-22 17:32:57.085 14730-14730 DesktopModeFlags com.example.myapplication D Toggle override initialized to: OVERRIDE_UNSET 2025-09-22 17:32:57.137 14730-14730 HWUI com.example.myapplication W Image decoding logging dropped! 2025-09-22 17:32:57.143 14730-14730 e.myapplication com.example.myapplication I hiddenapi: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (runtime_flags=0, domain=platform, api=unsupported) from Landroidx/appcompat/widget/ViewUtils; (domain=app) using reflection: allowed 2025-09-22 17:32:57.205 14730-14730 HWUI com.example.myapplication W Unknown dataspace 0 2025-09-22 17:32:57.499 14730-14730 InsetsController com.example.myapplication D hide(ime(), fromIme=false) 2025-09-22 17:32:57.499 14730-14730 ImeTracker com.example.myapplication I com.example.myapplication:120293d6: onCancelled at PHASE_CLIENT_ALREADY_HIDDEN 2025-09-22 17:32:57.728 14730-14735 e.myapplication com.example.myapplication I Compiler allocated 5042KB to compile void android.view.ViewRootImpl.performTraversals() 2025-09-22 17:33:01.507 14730-14744 HWUI com.example.myapplication I Davey! duration=701ms; Flags=0, FrameTimelineVsyncId=339287, IntendedVsync=12434071552112, Vsync=12434071552112, InputEventId=0, HandleInputStart=12434073050000, AnimationStart=12434073070200, PerformTraversalsStart=12434073339500, DrawStart=12434073461500, FrameDeadline=12434104885444, FrameStartTime=12434073038200, FrameInterval=16666666, WorkloadTarget=16666666, SyncQueued=12434073835100, SyncStart=12434073973100, IssueDrawCommandsStart=12434074070700, SwapBuffers=12434077768700, FrameCompleted=12434772941900, DequeueBufferDuration=51900, QueueBufferDuration=249800, GpuCompleted=12434772941900, SwapBuffersCompleted=12434078695800, DisplayPresentTime=0, CommandSubmissionCompleted=12434077768700, 2025-09-22 17:33:01.516 14730-14730 Choreographer com.example.myapplication I Skipped 41 frames! The application may be doing too much work on its main thread. 2025-09-22 17:33:01.525 14730-14730 AssistStructure com.example.myapplication I Flattened final assist data: 3948 bytes, containing 1 windows, 27 views 2025-09-22 17:33:03.060 14730-14782 ProfileInstaller com.example.myapplication D Installing profile for com.example.myapplication 2025-09-22 17:34:16.254 718-858 InputDispatcher system_server E channel 'c4201b3 com.example.myapplication/com.example.myapplication.MainActivity' ~ Channel is unrecoverably broken and will be disposed! 2025-09-22 17:34:17.321 14830-14830 e.myapplication com.example.myapplication I Late-enabling -Xcheck:jni 2025-09-22 17:34:17.358 14830-14830 e.myapplication com.example.myapplication I Using CollectorTypeCMC GC. 2025-09-22 17:34:17.359 14830-14830 e.myapplication com.example.myapplication W Unexpected CPU variant for x86: x86_64. Known variants: atom, sandybridge, silvermont, goldmont, goldmont-plus, goldmont-without-sha-xsaves, tremont, kabylake, alderlake, default 2025-09-22 17:34:17.372 14830-14830 nativeloader com.example.myapplication D Load libframework-connectivity-tiramisu-jni.so using APEX ns com_android_tethering for caller /apex/com.android.tethering/javalib/framework-connectivity-t.jar: ok 2025-09-22 17:34:17.419 14830-14830 nativeloader com.example.myapplication D Load /data/user/0/com.example.myapplication/code_cache/startup_agents/3fc68f17-agent.so using system ns (caller=<unknown>): ok 2025-09-22 17:34:17.415 14830-14830 re-initialized> com.example.myapplication W type=1400 audit(0.0:2120): avc: granted { execute } for path="/data/data/com.example.myapplication/code_cache/startup_agents/3fc68f17-agent.so" dev="dm-55" ino=352933 scontext=u:r:untrusted_app:s0:c217,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c217,c256,c512,c768 tclass=file app=com.example.myapplication 2025-09-22 17:34:17.427 14830-14830 e.myapplication com.example.myapplication W hiddenapi: DexFile /data/data/com.example.myapplication/code_cache/.studio/instruments-c9b0d10a.jar is in boot class path but is not in a known location 2025-09-22 17:34:17.587 14830-14830 e.myapplication com.example.myapplication W Redefining intrinsic method java.lang.Thread java.lang.Thread.currentThread(). This may cause the unexpected use of the original definition of java.lang.Thread java.lang.Thread.currentThread()in methods that have already been compiled. 2025-09-22 17:34:17.587 14830-14830 e.myapplication com.example.myapplication W Redefining intrinsic method boolean java.lang.Thread.interrupted(). This may cause the unexpected use of the original definition of boolean java.lang.Thread.interrupted()in methods that have already been compiled. 2025-09-22 17:34:17.743 14830-14830 nativeloader com.example.myapplication D Configuring clns-9 for other apk /data/app/~~BU8Zpa-Ptb6zWCD1jUuDVQ==/com.example.myapplication-bvhvD7PKJdnssUQso6AYEw==/base.apk. target_sdk_version=36, uses_libraries=, library_path=/data/app/~~BU8Zpa-Ptb6zWCD1jUuDVQ==/com.example.myapplication-bvhvD7PKJdnssUQso6AYEw==/lib/x86_64:/data/app/~~BU8Zpa-Ptb6zWCD1jUuDVQ==/com.example.myapplication-bvhvD7PKJdnssUQso6AYEw==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.example.myapplication 2025-09-22 17:34:17.750 14830-14830 e.myapplication com.example.myapplication I AssetManager2(0x79d591a4c758) locale list changing from [] to [en-US] 2025-09-22 17:34:17.752 14830-14830 e.myapplication com.example.myapplication I AssetManager2(0x79d591a46fd8) locale list changing from [] to [en-US] 2025-09-22 17:34:17.760 14830-14830 GraphicsEnvironment com.example.myapplication V Currently set values for: 2025-09-22 17:34:17.761 14830-14830 GraphicsEnvironment com.example.myapplication V angle_gl_driver_selection_pkgs=[] 2025-09-22 17:34:17.761 14830-14830 GraphicsEnvironment com.example.myapplication V angle_gl_driver_selection_values=[] 2025-09-22 17:34:17.761 14830-14830 GraphicsEnvironment com.example.myapplication V com.example.myapplication is not listed in per-application setting 2025-09-22 17:34:17.761 14830-14830 GraphicsEnvironment com.example.myapplication V ANGLE allowlist from config: com.dreamgames.royalmatch com.dts.freefiremax com.dxx.firenow com.gramgames.mergedragons com.ludo.king com.mojang.minecraftpe com.my.defense com.nintendo.zaka com.os.airforce com.playrix.fishdomdd.gplay io.teslatech.callbreak jp.konami.prospia net.peakgames.toonblast 2025-09-22 17:34:17.761 14830-14830 GraphicsEnvironment com.example.myapplication V com.example.myapplication is not listed in ANGLE allowlist or settings, returning default 2025-09-22 17:34:17.762 14830-14830 GraphicsEnvironment com.example.myapplication V Neither updatable production driver nor prerelease driver is supported. 2025-09-22 17:34:17.810 14830-14845 DisplayManager com.example.myapplication I Choreographer implicitly registered for the refresh rate. 2025-09-22 17:34:17.813 14830-14830 e.myapplication com.example.myapplication I AssetManager2(0x79d591a4f638) locale list changing from [] to [en-US] 2025-09-22 17:34:17.842 14830-14845 EGL_emulation com.example.myapplication I Opening libGLESv1_CM_emulation.so 2025-09-22 17:34:17.842 14830-14845 EGL_emulation com.example.myapplication I Opening libGLESv2_emulation.so 2025-09-22 17:34:17.870 14830-14845 HWUI com.example.myapplication W Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... 2025-09-22 17:34:17.870 14830-14845 HWUI com.example.myapplication W Failed to initialize 101010-2 format, error = EGL_SUCCESS 2025-09-22 17:34:17.889 14830-14830 AppCompatDelegate com.example.myapplication D Checking for metadata for AppLocalesMetadataHolderService : Service not found 2025-09-22 17:34:17.890 14830-14830 e.myapplication com.example.myapplication I AssetManager2(0x79d591a4da18) locale list changing from [] to [en-US] 2025-09-22 17:34:17.896 14830-14830 ashmem com.example.myapplication E Pinning is deprecated since Android Q. Please use trim or other methods. 2025-09-22 17:34:17.968 14830-14830 e.myapplication com.example.myapplication I hiddenapi: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (runtime_flags=0, domain=platform, api=unsupported) from Landroidx/appcompat/widget/ViewUtils; (domain=app) using reflection: allowed 2025-09-22 17:34:18.052 14830-14830 CompatChangeReporter com.example.myapplication D Compat change id reported: 377864165; UID 10217; state: ENABLED 2025-09-22 17:34:18.053 14830-14830 DesktopModeFlags com.example.myapplication D Toggle override initialized to: OVERRIDE_UNSET 2025-09-22 17:34:18.079 14830-14830 HWUI com.example.myapplication W Image decoding logging dropped! 2025-09-22 17:34:18.084 14830-14830 e.myapplication com.example.myapplication I hiddenapi: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (runtime_flags=0, domain=platform, api=unsupported) from Landroidx/appcompat/widget/ViewUtils; (domain=app) using reflection: allowed 2025-09-22 17:34:18.134 14830-14830 HWUI com.example.myapplication W Unknown dataspace 0 2025-09-22 17:34:18.402 14830-14830 InsetsController com.example.myapplication D hide(ime(), fromIme=false) 2025-09-22 17:34:18.403 14830-14830 ImeTracker com.example.myapplication I com.example.myapplication:a102fc0: onCancelled at PHASE_CLIENT_ALREADY_HIDDEN 2025-09-22 17:34:18.561 14830-14835 e.myapplication com.example.myapplication I Compiler allocated 5042KB to compile void android.view.ViewRootImpl.performTraversals() 2025-09-22 17:34:20.485 14830-14830 AssistStructure com.example.myapplication I Flattened final assist data: 3948 bytes, containing 1 windows, 27 views 2025-09-22 17:34:22.900 14830-14859 ProfileInstaller com.example.myapplication D Installing profile for com.example.myapplication
09-23
7167 7167 I HWUI : SupportApps size 0 行 274039: 12-03 08:04:01.301516 7167 7167 I HWUI : SupportApps size 0 行 274045: 12-03 08:04:01.307457 7167 7735 D OplusGraphicsEvent: OplusGraphicsEventListener create now! 行 274046: 12-03 08:04:01.308471 7167 7167 I tencent.jkchess: AssetManager2(0xb400007b254a0d28) locale list changing from [] to [zh-CN] 行 274046: 12-03 08:04:01.308471 7167 7167 I tencent.jkchess: AssetManager2(0xb400007b254a0d28) locale list changing from [] to [zh-CN] 行 274047: 12-03 08:04:01.308669 7167 7735 D OplusGraphicsEvent: addEventListener success! 行 274048: 12-03 08:04:01.308977 7167 7735 D ExtensionsLoader: createInstance(64bit) : createExtendedFactory 行 274049: 12-03 08:04:01.309124 7167 7167 D ResourcesManagerExtImpl: applyConfigurationToAppResourcesLocked app.getDisplayId() return callback.displayId:0 行 274049: 12-03 08:04:01.309124 7167 7167 D ResourcesManagerExtImpl: applyConfigurationToAppResourcesLocked app.getDisplayId() return callback.displayId:0 行 274050: 12-03 08:04:01.309452 7167 7735 D ExtensionsLoader: Opened libSchedAssistExtImpl.so 行 274051: 12-03 08:04:01.309557 7167 7735 E SchedAssist: open sharedFd failed with error=No such file or directory 行 274052: 12-03 08:04:01.309594 7167 7735 E SchedAssist: open sharedFd failed with error=No such file or directory 行 274053: 12-03 08:04:01.309639 7167 7735 E SchedAssist: open sharedFd failed with error=Permission denied 行 274054: 12-03 08:04:01.309653 7167 7735 E SchedAssist: open sharedFd failed with error=Permission denied 行 274055: 12-03 08:04:01.309659 7167 7735 E SchedAssist: open sharedFd failed with error=Permission denied 行 274056: 12-03 08:04:01.309700 7167 7735 I DisplayManager: Choreographer implicitly registered for the refresh rate. 行 274067: 12-03 08:04:01.323928 7167 7167 E OplusPredictiveBackController: NoSuchMethodException 行 274067: 12-03 08:04:01.323928 7167 7167 E OplusPredictiveBackController: NoSuchMethodException 行 274068: 12-03 08:04:01.324130 7167 7167 D OplusPredictiveBackController: initPredictiveBackConfig for com.tencent.gcloud.msdk.core.policy.ZGamePolicyActivity@44ee17c initPredictiveBackConfig mShouldInterceptKeyEvent false 行 274068: 12-03 08:04:01.324130 7167 7167 D OplusPredictiveBackController: initPredictiveBackConfig for com.tencent.gcloud.msdk.core.policy.ZGamePolicyActivity@44ee17c initPredictiveBackConfig mShouldInterceptKeyEvent false 行 274070: 12-03 08:04:01.324888 7167 7167 I oplus.android.OplusFrameworkFactoryImpl: Unknow feature:IOplusTextViewRTLUtilForUG 行 274070: 12-03 08:04:01.324888 7167 7167 I oplus.android.OplusFrameworkFactoryImpl: Unknow feature:IOplusTextViewRTLUtilForUG 行 274077: 12-03 08:04:01.329409 2050 2962 I AccessibilityManagerService: Added user client for pid:7167 and userId:0 行 274084: 12-03 08:04:01.336167 7167 7167 D DesktopModeFlags: Toggle override initialized to: OVERRIDE_UNSET 行 274084: 12-03 08:04:01.336167 7167 7167 D DesktopModeFlags: Toggle override initialized to: OVERRIDE_UNSET 行 274086: 12-03 08:04:01.336513 7167 7167 D OplusWindowManager: get WMS extension: android.os.BinderProxy@c099226 行 274086: 12-03 08:04:01.336513 7167 7167 D OplusWindowManager: get WMS extension: android.os.BinderProxy@c099226 行 274092: 12-03 08:04:01.347428 7167 7167 E OplusCustomizeRestrictionManager: sInstance is null, start a new sInstance 行 274092: 12-03 08:04:01.347428 7167 7167 E OplusCustomizeRestrictionManager: sInstance is null, start a new sInstance 行 274093: 12-03 08:04:01.347470 7167 7735 D ExtensionsLoader: createInstance(64bit) : createExtendedFactory 行 274094: 12-03 08:04:01.347777 7167 7735 D ExtensionsLoader: Opened libeglextimpl.so 行 274095: 12-03 08:04:01.348072 7167 7735 D PreCache: [IPreCacheRus]loadRUSConfigs#102 failed to transact: -22 prc:com.tencent.jkchess 行 274097: 12-03 08:04:01.352520 7167 7167 D ScrollOptimizationHelper: can't find the config file for optimizaiton 行 274097: 12-03 08:04:01.352520 7167 7167 D ScrollOptimizationHelper: can't find the config file for optimizaiton 行 274098: 12-03 08:04:01.352551 7167 7167 D ScrollOptimizationHelper: will not debug for debug is false 行 274098: 12-03 08:04:01.352551 7167 7167 D ScrollOptimizationHelper: will not debug for debug is false 行 274099: 12-03 08:04:01.352885 7167 7167 I oplus.android.OplusFrameworkFactoryImpl: get feature:IOplusDynamicVsyncFeature 行 274099: 12-03 08:04:01.352885 7167 7167 I oplus.android.OplusFrameworkFactoryImpl: get feature:IOplusDynamicVsyncFeature 行 274100: 12-03 08:04:01.352951 7167 7167 I oplus.android.OplusFrameworkFactoryImpl: get feature:IOplusDynamicVsyncFeature 行 274100: 12-03 08:04:01.352951 7167 7167 I oplus.android.OplusFrameworkFactoryImpl: get feature:IOplusDynamicVsyncFeature 行 274104: 12-03 08:04:01.356028 7167 7167 D nativeloader: Load libpowerhalwrap_jni.so using system ns (caller=/system_ext/framework/mediatek-framework.jar): ok 行 274104: 12-03 08:04:01.356028 7167 7167 D nativeloader: Load libpowerhalwrap_jni.so using system ns (caller=/system_ext/framework/mediatek-framework.jar): ok 行 274105: 12-03 08:04:01.356212 7167 7167 I PowerHalWrapper: PowerHalWrapper.getInstance 行 274105: 12-03 08:04:01.356212 7167 7167 I PowerHalWrapper: PowerHalWrapper.getInstance 行 274107: 12-03 08:04:01.356285 7167 7167 I PowerHalWrapper: PowerHalWrapper.getInstance 行 274107: 12-03 08:04:01.356285 7167 7167 I PowerHalWrapper: PowerHalWrapper.getInstance 行 274108: 12-03 08:04:01.356332 7167 7167 I M-ProMotion: M-ProMotion is disabled 行 274108: 12-03 08:04:01.356332 7167 7167 I M-ProMotion: M-ProMotion is disabled 行 274109: 12-03 08:04:01.356381 7167 7167 I oplus.android.OplusFrameworkFactoryImpl: get feature:IOplusDynamicVsyncFeature 行 274109: 12-03 08:04:01.356381 7167 7167 I oplus.android.OplusFrameworkFactoryImpl: get feature:IOplusDynamicVsyncFeature 行 274115: 12-03 08:04:01.372153 7167 7167 I GCloudCoreUtils: try to load libgcloudcore.so for the first time 行 274115: 12-03 08:04:01.372153 7167 7167 I GCloudCoreUtils: try to load libgcloudcore.so for the first time结合上文一块分析
12-05
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值