NullPointerException On Android.os.Bundle

前端 未结 3 2010
星月不相逢
星月不相逢 2020-12-18 11:23

I have some problem with my code, when I need to transfer some data from one Activity to another one. First Activity (ViewCashflow) a

3条回答
  •  粉色の甜心
    2020-12-18 11:43

    if it in fragment you can use :

    if (getArguments() != null) {
    
              loginBody = getArguments().getParcelable(getActivity().getResources().getString(R.string.logInBodyParcelData));
        }
       /* } catch (Exception e) {
            e.printStackTrace();
        }*/
        if (loginBody != null) {
            setProfile();
    
        }
    

提交回复
热议问题