gpt4 book ai didi

Android 中的 android.os.TransactionTooLargeException 错误

转载 作者:行者123 更新时间:2023-11-30 05:08:32 25 4
gpt4 key购买 nike

我的 Android 应用程序返回 android.os.TransactionTooLargeException 时出现问题,即使我清除了 Fragment 中的所有数据也是如此。

从我实现的 fragment - 见下面的代码,我开始一个新的 Activity ,该 Activity 开始但一秒钟后 android.os.TransactionTooLargeException 被抛出。我试图清理所有包等,因此该 fragment 尽可能简单,但它抛出:

java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 608932 bytes.

请问您知道问题出在哪里吗?

public class ShowDetailFragment extends Fragment {

public static boolean was207Called = false;

public interface ExpandViewListener {
void onExpandClicked();
}

public void setFullScreenListener(ExpandViewListener listener) {
}

public ShowDetailFragment() {
}

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_show_detail, null, true);
return v;
}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
}

@Override
public void onResume() {
super.onResume();
}

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, null);
Intent i = new Intent(getActivity().getApplicationContext(), ForgottenPasswordActivity.class);
startActivity(i);
return;
}

@Override
public void onPause() {
super.onPause();
}

@Override
public void onSaveInstanceState(Bundle outState) {
}

public void onFragmentRemoved() {
Log.d("XXXXX", "Frag removed");
}

@Override
public void onStop() {
super.onStop();
Log.d("XXXX", "Stopping");
}
}

最佳答案

请尝试:-

public class ShowDetailFragment extends Fragment {

public static boolean was207Called = false;

public interface ExpandViewListener {
void onExpandClicked();
}

public void setFullScreenListener(ExpandViewListener listener) {
}

public ShowDetailFragment() {
}

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_show_detail, container, false);
return v;
}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
}

@Override
public void onResume() {
super.onResume();

Intent i = new Intent(getActivity(),
ForgottenPasswordActivity.class);
startActivity(i);
}

public void onFragmentRemoved() {
Log.d("XXXXX", "Frag removed");
}

@Override
public void onStop() {
super.onStop();
Log.d("XXXX", "Stopping");
}
}

关于Android 中的 android.os.TransactionTooLargeException 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54107274/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com