This error occurs when you are trying to call a method on a null object reference. In this case, the virtual method 'getString' is being called on a Bundle object that is null.

To fix this error, you need to make sure that the Bundle object is not null before calling any methods on it. You can do this by adding a null check before calling the method:

Bundle bundle = getIntent().getExtras();
if (bundle != null) {
    String value = bundle.getString("key");
    // Your code here
}

In this example, the 'value' variable will only be assigned a value if the bundle object is not null

ttempt to invoke virtual method javalangString androidosBundlegetStringjavalangString on a null object reference

原文地址: https://www.cveoy.top/t/topic/ht5m 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录