0

I have first a bottom navigation but on default I call a as follow.

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_tab);

        fragmentManager = getSupportFragmentManager();
        fragment = new ListActivityFragment1();
        final FragmentTransaction transaction = fragmentManager.beginTransaction();
        transaction.add(R.id.main_container, fragment).commit();

Bellow is my ListActivityFragment1 codes. Infact my codes the default codes from the Android Studio. I have done a lot of reading all are taking about bitmap involvement but in my case no such thing of importing bitmap etc. I am just going to start using a toolbar.

public class ListActivityFragment1 extends Fragment {

    private static final String ARG_PARAM1 = "param1";
    private static final String ARG_PARAM2 = "param2";

    // TODO: Rename and change types of parameters
    private String mParam1;
    private String mParam2;

    private OnFragmentInteractionListener mListener;

    public ListActivityFragment1() {
        // Required empty public constructor
    }

    // TODO: Rename and change types and number of parameters
    public static ListActivityFragment1 newInstance(String param1, String param2) {
        ListActivityFragment1 fragment = new ListActivityFragment1();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, param1);
        args.putString(ARG_PARAM2, param2);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            mParam1 = getArguments().getString(ARG_PARAM1);
            mParam2 = getArguments().getString(ARG_PARAM2);
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_list_activity_fragment1, container, false);
    }

    // TODO: Rename method, update argument and hook method into UI event
    public void onButtonPressed(Uri uri) {
        if (mListener != null) {
            mListener.onFragmentInteraction(uri);
        }
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        if (context instanceof OnFragmentInteractionListener) {
            mListener = (OnFragmentInteractionListener) context;
        } else {
            throw new RuntimeException(context.toString()
                    + " must implement OnFragmentInteractionListener");
        }
    }

    @Override
    public void onDetach() {
        super.onDetach();
        mListener = null;
    }

    public interface OnFragmentInteractionListener {
        // TODO: Update argument type and name
        void onFragmentInteraction(Uri uri);
    }
}

Here is the stacktrace I captured.

03-03 07:20:58.073 1702-1715/system_process E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 104)
03-03 07:20:58.076 1702-1715/system_process E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 104)
03-03 07:20:58.082 1978-1978/com.android.inputmethod.latin E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 88)
03-03 07:20:58.085 1978-1978/com.android.inputmethod.latin E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 92)
03-03 07:20:58.088 1978-1978/com.android.inputmethod.latin E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 88

Additional logcat.

03-03 08:07:03.654 1350-1759/? W/WVCdm: BufferReader::Read<T> : Failure during parse: Not enough bytes (4)
03-03 08:07:03.654 1350-1759/? D/WVCdm: PrepareKeyRequest: nonce=4212486394
03-03 08:07:07.284 2706-3072/com.google.android.gms I/Ads: Parental control value is stale. Refreshing.
03-03 08:07:07.284 2706-3072/com.google.android.gms W/Ads: Play store is not installed or the service for parental controls is not available.
03-03 08:07:08.974 2706-2716/com.google.android.gms I/art: Background partial concurrent mark sweep GC freed 15028(1224KB) AllocSpace objects, 23(460KB) LOS objects, 33% free, 7MB/11MB, paused 239.759ms total 1.281s
03-03 08:07:10.983 2706-2716/com.google.android.gms I/art: Background partial concurrent mark sweep GC freed 28761(2MB) AllocSpace objects, 12(248KB) LOS objects, 29% free, 9MB/13MB, paused 251.178ms total 1.297s
03-03 08:07:12.978 2706-3130/com.google.android.gms I/Icing: updateResources: need to parse snt{com.google.android.gms}
03-03 08:07:13.302 1971-2520/com.google.android.gms.persistent E/NetworkScheduler.SR: Invalid parameter app
03-03 08:07:14.528 1971-2482/com.google.android.gms.persistent E/NetworkScheduler.SR: Invalid parameter app
03-03 08:07:14.786 2706-3120/com.google.android.gms I/Icing: updateResources: need to parse snt{com.google.android.gms}
03-03 08:07:14.943 2706-2716/com.google.android.gms I/art: Background partial concurrent mark sweep GC freed 25328(2MB) AllocSpace objects, 10(200KB) LOS objects, 29% free, 9MB/13MB, paused 123.931ms total 231.671ms
03-03 08:07:18.317 2706-3132/com.google.android.gms I/Icing: updateResources: need to parse snt{com.google.android.gms}
03-03 08:07:45.774 1350-1350/? W/WVCdm: BufferReader::Read<T> : Failure during parse: Not enough bytes (4)
03-03 08:07:45.774 1350-1350/? D/WVCdm: PrepareKeyRequest: nonce=358789497

The problem here like cricket suggested that not to use Fragment from Android Studio template but to build my own in future. As I have done for other I will follow that. Thus that is why this is not similar to other post here.

user5313398
  • 713
  • 3
  • 9
  • 28

0 Answers0