我有一个错误,当我运行我的应用程序:
E/Parcel: Reading a NULL string not supported here.
Reading a NULL string not supported here.
D/gift-manager: getGiftPara pkg(com.example.myhomie,260,), ret=-22
I/libMEOW_gift: ctx:0xb40000786ccfd928, ARC not Enabled.
E/libEGL: Invalid file path for libcolorx-loader.so
I/chatty: uid=10300(com.example.myhomie) RenderThread identical 62 lines
E/libEGL: Invalid file path for libcolorx-loader.so
E/ion: ioctl c0044901 failed with code -1: Invalid argument
E/Parcel: Reading a NULL string not supported here.
Mycode:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cctv);
start = findViewById(R.id.button2);
start.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent =
getPackageManager().getLaunchIntentForPackage("com.android.chrome");
startActivity(intent);
}
});
}
谁能告诉我错误在哪里?非常感谢
错误是:E/Parcel: Reading a NULL string not supported here.
将意图代码放入try-catch中。还要检查getPackageManager().getLaunchIntentForPackage("com.android.chrome");