startActivity(intent)不起作用

时间:2013-10-10 07:26:49

标签: android

我正在处理一个应用程序。我遇到了一个问题。我的问题是,当我打电话给startActivity(intent)时,它不起作用,我的logcat显示

!!!失败的粘合剂交易!!!

请帮我解决这个问题。 感谢

我的代码是

listview3.setOnItemClickListener(new OnItemClickListener()
{
public void onItemClick(AdapterView<?> arg0, View view, int arg2,
long arg3) 
{    



LinearLayout linear = (LinearLayout)view.findViewById(R.id.linearlist);
selected_section_id=webservice_sectionid.get(arg2);
                      selected_section_heading=webservice_sectionheading.get(arg2);
selected_section_no=webservice_sectionno.get(arg2);

String[] array_sectionid = new String[webservice_sectionid.size()];
                String[] array_sectionheading = new  String[webservice_sectionheading.size()];
String[] array_sectionno = new String[webservice_sectionno.size()];
String noofpage=String.valueOf(webservice_sectionno.size());
Intent intent = null;

intent=new Intent(Ruleservice1.this,SectionWebPage1.class);
intent.putExtra("SectionId", selected_section_id);
intent.putExtra("SectionHeading", selected_section_heading);
intent.putExtra("ActId", selectedvalue_id);
intent.putExtra("SelectListPosition", String.valueOf(arg2)); 
intent.putExtra("ActId_g", (ArrayList<String>) webservice_global_actid); 
intent.putExtra("ActHeading_g", (ArrayList<String>) webservice_global_actheading);   
intent.putExtra("SectionId1", selected_section_id1);
intent.putExtra("SectionNo", selected_section_no);
intent.putExtra("SectionNo1", selected_section_no1);
intent.putExtra("ActHeading", selectedvalue_heading);
intent.putExtra("array_sectionid", (ArrayList<String>) webservice_sectionid);
intent.putExtra("array_sectionheading", (ArrayList<String>) webservice_sectionheading);
intent.putExtra("array_sectionno", (ArrayList<String>) webservice_sectionno);
intent.putExtra("arrayActId", (ArrayList<String>)webservice_actid);
intent.putExtra("arrayActHeading", (ArrayList<String>)webservice_actheading);
intent.putExtra("flag", "0");
intent.putExtra("offlineStatus", offlineflag+"");
intent.putExtra("count", "Page "+String.valueOf(arg2+1)+" of "+  webservice_sectionno.size());
intent.putExtra("fromwhichpage", "rule");
intent.putExtra("noofpage", noofpage);
intent.putExtra("searchtext", SearchText);
intent.putExtra("hideshowtext", "Show");
intent.putExtra("arrayActCatid", selectedcatid);
startActivity(intent);
}

});

我的Logcat

10-10 13:02:23.453: D/dalvikvm(2527): GC_CONCURRENT freed 3009K, 31% free 11791K/17031K, paused 2ms+3ms
10-10 13:02:23.563: D/dalvikvm(2527): GC_FOR_ALLOC freed 4K, 31% free 11790K/17031K, paused 26ms
10-10 13:02:23.573: I/dalvikvm-heap(2527): Grow heap (frag case) to 15.275MB for 3738592-byte allocation
10-10 13:02:23.643: D/dalvikvm(2527): GC_CONCURRENT freed 0K, 26% free 15441K/20743K, paused 2ms+3ms
10-10 13:02:23.663: D/dalvikvm(2527): GC_FOR_ALLOC freed 4544K, 48% free 10898K/20743K, paused 27ms
10-10 13:02:23.673: I/dalvikvm-heap(2527): Grow heap (frag case) to 14.403MB for 3738642-byte allocation
10-10 13:02:23.733: D/dalvikvm(2527): GC_FOR_ALLOC freed <1K, 30% free 14548K/20743K, paused 26ms
10-10 13:02:23.743: I/dalvikvm-heap(2527): Grow heap (frag case) to 19.751MB for 5607958-byte allocation
10-10 13:02:23.803: D/dalvikvm(2527): GC_CONCURRENT freed 3651K, 38% free 16374K/26247K, paused 1ms+4ms
10-10 13:02:23.833: D/dalvikvm(2527): GC_FOR_ALLOC freed 0K, 38% free 16374K/26247K, paused 29ms
10-10 13:02:23.843: I/dalvikvm-heap(2527): Grow heap (frag case) to 19.751MB for 3738646-byte allocation
10-10 13:02:23.903: D/dalvikvm(2527): GC_FOR_ALLOC freed <1K, 24% free 20025K/26247K, paused 28ms
10-10 13:02:23.913: I/dalvikvm-heap(2527): Grow heap (frag case) to 23.317MB for 3738700-byte allocation
10-10 13:02:23.973: D/dalvikvm(2527): GC_CONCURRENT freed 5476K, 40% free 18199K/29959K, paused 2ms+4ms
10-10 13:02:24.013: D/dalvikvm(2527): GC_FOR_ALLOC freed 3651K, 52% free 14548K/29959K, paused 31ms
10-10 13:02:24.023: I/dalvikvm-heap(2527): Grow heap (frag case) to 19.751MB for 5608046-byte allocation
10-10 13:02:24.093: D/dalvikvm(2527): GC_FOR_ALLOC freed 3651K, 54% free 16374K/35463K, paused 30ms
10-10 13:02:24.123: D/dalvikvm(2527): GC_FOR_ALLOC freed 0K, 54% free 16374K/35463K, paused 32ms
10-10 13:02:24.133: I/dalvikvm-heap(2527): Grow heap (frag case) to 19.751MB for 3738702-byte allocation
10-10 13:02:24.203: D/dalvikvm(2527): GC_CONCURRENT freed 129K, 44% free 19896K/35463K, paused 2ms+4ms
10-10 13:02:24.503: D/dalvikvm(2527): GC_CONCURRENT freed 5969K, 56% free 15957K/35463K, paused 2ms+5ms
10-10 13:02:24.803: D/dalvikvm(2527): GC_CONCURRENT freed 507K, 51% free 17497K/35463K, paused 2ms+5ms
10-10 13:02:25.143: D/dalvikvm(2527): GC_CONCURRENT freed 476K, 47% free 19115K/35463K, paused 3ms+6ms
10-10 13:02:25.473: D/dalvikvm(2527): GC_CONCURRENT freed 508K, 42% free 20684K/35463K, paused 2ms+6ms
10-10 13:02:25.813: D/dalvikvm(2527): GC_CONCURRENT freed 476K, 38% free 22256K/35463K, paused 2ms+6ms
10-10 13:02:26.163: D/dalvikvm(2527): GC_CONCURRENT freed 501K, 33% free 23796K/35463K, paused 2ms+6ms
10-10 13:02:26.553: D/dalvikvm(2527): GC_CONCURRENT freed 915K, 30% free 24981K/35463K, paused 2ms+7ms
10-10 13:02:28.643: E/JavaBinder(2527): !!! FAILED BINDER TRANSACTION !!!

2 个答案:

答案 0 :(得分:4)

两件事:intent.putExtra("searchtext", SearchText);看起来不对,可能是复制粘贴错误?

另外,请确保不要将大量数据放入Intent中。字符串值和整数很好,但您似乎是使用ArrayLists传递应用程序数据,这不是您将信息从一个Activity传输到另一个Activity的方式。您应该将它们放在数据库中,只传输相关的ID或将它们存储在您从每个活动(如应用程序对象)引用的某个缓存中。

另请查看Tim发布的链接。

答案 1 :(得分:1)

我刚发现这个 - &gt; Failed binder transaction when putting an bitmap dynamically in a widget

在这篇文章中,他们说这个错误是因为大数据。 我不知道这是否是同样的原因,但如果你用意图通过更少的数据,也要尝试错误。 在上面的链接中,他们写了1 MB的限制。

抱歉我的英语不好。 =)