2013-10-10 44 views
2

我正在處理應用程序。我陷入了一個問題。我的問題是,當我打電話startActivity(intent)那麼它不工作,我的logcat顯示startActivity(意圖)不起作用

!!!失敗的粘合劑交易!!!

請幫我解決這個問題。 感謝

我的代碼是

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 !!! 
+0

嘗試通過'JSON字符串'並將其轉換爲被調用的活動。 –

+0

看起來像你的數據太大而無法進入意圖。 – njzk2

+0

你滿意的意圖......你不應該這樣做。 – JoxTraex

回答

4

兩件事:intent.putExtra("searchtext", SearchText);看起來不對,可能是複製粘貼錯誤?

此外,請確保您不要將大量數據放入意圖。字符串值和整數都很好,但是你似乎在使用ArrayLists傳遞應用程序數據,這不是你如何將信息從一個Activity傳送到另一個。您應該將它們放在數據庫中,只傳送相關的ID或將它們存儲在某個緩存中,以便您從每個活動(如應用程序對象)引用它們。

另請檢查Tim發佈的鏈接。

1

我剛剛發現這一點 - >Failed binder transaction when putting an bitmap dynamically in a widget

在這篇文章中,他們說,這個錯誤是因爲對大數據。 我不知道這是否會是同樣的原因,但嘗試如果錯誤也發生,如果你傳遞意圖較少的數據。 在我上面的鏈接中,他們寫了1 MB的限制。

btw對不起,我的英語不好。 =)