ib.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if(et.getText()!=null){
tosearch=et.getText().toString();
Intent seach=new Intent(getActivity(), Search.class);
seach.putExtra("key", seach);
startActivity(seach);
}
}
});
我的 ImageButton 点击监听器在上面。我得到以下错误
07-25 01:30:59.017: D/dalvikvm(1699): GC_EXTERNAL_ALLOC freed 127K, 50% free 2843K/5575K, external 5307K/5765K, paused
31ms 07-25 01:31:02.791: I/dalvikvm(1699): threadid=1: stack overflow on call to Landroid/os/Parcel;.writeInt:VI
07-25 01:31:02.791: I/dalvikvm(1699): method requires 8+20+0=28 bytes, fp is 0x4428a318 (24 left)
07-25 01:31:02.791: I/dalvikvm(1699): expanding stack end (0x4428a300 to 0x4428a000)
07-25 01:31:02.791: I/dalvikvm(1699): Shrank stack (to 0x4428a300, curFrame is 0x4428cebc)
07-25 01:31:02.791: D/AndroidRuntime(1699): Shutting down VM
07-25 01:31:02.791: W/dalvikvm(1699): threadid=1: thread exiting with uncaught exception (group=0x40015578)
07-25 01:31:02.849: E/AndroidRuntime(1699): FATAL EXCEPTION: main
07-25 01:31:02.849: E/AndroidRuntime(1699): java.lang.StackOverflowError
07-25 01:31:02.849: E/AndroidRuntime(1699): at android.net.Uri.writeToParcel(Uri.java:1645)
07-25 01:31:02.849: E/AndroidRuntime(1699): at android.content.Intent.writeToParcel(Intent.java:5601)
07-25 01:31:02.849: E/AndroidRuntime(1699): at android.os.Parcel.writeParcelable(Parcel.java:1151)
我的应用程序由包含三个片段和第二个活动的 mainactivity 组成。我已经搜索但找不到任何有用的东西。请帮助解决错误。