2013-09-02 1 views
1

안드로이드 2에서 안드로이드 4로 넘어가는 소스 코드를 변경하려고합니다. 코드가 잘못되어 응용 프로그램이 시작되지 않습니다. 하지만 처음에는 로그인이 있습니다. '로그인'을 클릭하면 앱이 다운됩니다. logcat에 SimpleExpandableListAdapter에 문제가 있음이 표시됩니다. 이것은 SimpleExpandableListAdapter를 사용하는 코드의 일부입니다안드로이드 응용 프로그램의 SimpleExpandableListAdapter 문제

expListAdapter = new SimpleExpandableListAdapter(_ContactScreen_object, 
       _groupSections, // groupData describes the first-level entries 
       R.layout.group_row, // Layout for the first-level entries 
       new String[] { "sectionName" }, // Key in the groupData maps to 
       // display 
       new int[] { R.id.groupname }, // Data under "friendName" key 
       // goes into this TextView 
       _result, // childData describes second-level entries 
       R.layout.child_row, // Layout for second-level entries 
       new String[] { "friendName", "status" }, // Keys in childData 
       // maps to display 
       new int[] { R.id.childname, R.id.rgb } // Data under the keys 
     // above go into these 
     // TextViews 
     ) 

로그 캣 :

enter image description here

당신이 문제는 코드가 오래이라고 생각하십니까? SimpleExpandableListAdapter의 구조가 지금은 다른가요? 무엇을 바꾸어야합니까?

+1

예외 스택 추적을 게시하십시오. – laalto

+2

logcat을 추가했습니다. –

답변

0

Context param _ContactScreen_objectnull입니다.

mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 

더 많은 컨텍스트 (원문) 추가 지원을 제공하는 데 필요한 코드의 다음은 SimpleExpandableListAdapter.java 라인 (210)입니다.

+0

코드가 더 필요합니까? 활동이 너무 길어졌습니다. –

+0

'null'컨텍스트를 직접 해결할 수 있으면 추가 코드가 필요하지 않습니다. 그렇지 않으면'_ContactScreen_object'가 무엇인지와 초기화 방법을 보여주는 코드를 포함하십시오. – laalto

+0

이것을 의미합니까? 'public static ContactScreen _ContactScreen_object = null;' –