public class CodeMainActicity extends Activity
{
private ExpandListAdapter ExpAdapter;
private ArrayList<ExpandListGroup> ExpListItems;
private ExpandableListView ExpandList;
public String[] groups = null;
public String[][] headers = null;
DisplayMetrics metrics;
int width;
public int GetDipsFromPixel(float paramFloat)
{
return (int)(0.5F + paramFloat * getResources().getDisplayMetrics().density);
}
public ArrayList<ExpandListGroup> SetStandardGroups()
{
ArrayList<ExpandListGroup> localArrayList1 = new ArrayList<ExpandListGroup>();
int i = 0;
if (i >=groups.length){
return localArrayList1;
}
ExpandListGroup localExpandListGroup = new ExpandListGroup();
localExpandListGroup.setName(groups[i]);
ArrayList<ExpandListChild> localArrayList2 = new ArrayList<ExpandListChild>();
for (int j = 0; ; j++)
{
if (j > 11){
while (headers[i][j] == null)
{
localExpandListGroup.setItems(localArrayList2);
localArrayList1.add(localExpandListGroup);
i++;
break;
}
}
ExpandListChild localExpandListChild = new ExpandListChild();
localExpandListChild.setName(headers[i][j]);
localExpandListChild.setTag(null);
localArrayList2.add(localExpandListChild);
}
}
public void onCreate(Bundle paramBundle)
{
this.groups = new String[11];
this.headers = ((String[][])Array.newInstance(String.class, new int[] { 14, 10 }));
this.groups[0] = "Data Types";
this.groups[1] = "Date Time";
this.groups[2] = "Regular Expressions";
this.groups[3] = "Class";
this.groups[4] = "Collections";
this.groups[5] = "Generics";
this.groups[6] = "Reflection";
this.groups[7] = "Security";
this.groups[8] = "Design Patterns";
this.groups[9] = "Thread";
this.groups[10] = "File Stream";
this.headers[0][0] = "Boxing and Unboxing";
this.headers[0][1] = "Complex Type";
this.headers[0][2] = "Enum";
this.headers[0][3] = "Tuple type";
this.headers[0][4] = "Hex to Int";
this.headers[0][5] = "Nullable Integer";
this.headers[0][6] = "Custom ToString()";
this.headers[0][7] = "Checked() and Unchecked()";
this.headers[0][8] = "Overflow";
this.headers[0][9] = "Char methods";
this.headers[1][0] = "Get between Days";
this.headers[1][1] = "Add one week to current date";
this.headers[1][2] = "DateTime Compare";
this.headers[2][0] = "Email Validation";
this.headers[2][1] = "URL validation";
this.headers[2][2] = "Zipcode validation";
this.headers[3][0] = "Access modifiers";
this.headers[3][1] = "Inheritance";
this.headers[3][2] = "Interface";
this.headers[3][3] = "Method Overloading";
this.headers[3][4] = "Overriding";
this.headers[3][5] = "Abstract class";
this.headers[4][0] = "Array List";
this.headers[4][1] = "Hash Table";
this.headers[4][2] = "Dictionary";
this.headers[5][0] = "Simple Generic hierarchy";
this.headers[5][1] = "Generic IEnumerable";
this.headers[5][2] = "Generic Collection class";
this.headers[6][0] = "AppDomain Setup";
this.headers[6][1] = "Type.GetMethods";
this.headers[6][2] = "Assembly Version Information";
this.headers[7][0] = "MD5 encode";
this.headers[7][1] = "File Checksum";
this.headers[7][2] = "Password Encryption";
this.headers[8][0] = "Facade Pattern";
this.headers[8][1] = "Factory Pattern";
this.headers[8][2] = "Observer Pattern";
this.headers[8][3] = "Singleton Pattern";
this.headers[8][4] = "Adapter Pattern";
this.headers[9][0] = "Creating Thread";
this.headers[9][1] = "Asynchronous Calls";
this.headers[9][2] = "Mutex";
this.headers[10][0] = "Display File contents";
this.headers[10][1] = "Write to a file";
this.headers[10][2] = "Append to File";
super.onCreate(paramBundle);
requestWindowFeature(1);
setContentView(R.layout.codemainscreen);
Button localButton = (Button)findViewById(R.id.btnhome);
this.ExpandList = ((ExpandableListView)findViewById(R.id.ExpList));
ExpListItems = SetStandardGroups();
this.ExpAdapter = new ExpandListAdapter(this, this.ExpListItems);
this.metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(this.metrics);
this.width = this.metrics.widthPixels;
this.ExpandList.setIndicatorBounds(this.width - GetDipsFromPixel(50.0F), this.width - GetDipsFromPixel(10.0F));
this.ExpandList.setAdapter(this.ExpAdapter);
-3
A
답변
1
당신은에서에게 어떤이가있는 동안 충돌 후 즉이 루프
for (int j = 0; ; j++)
에는 조건이 없습니다.
for (int j = 0; /* add condition here */ ; j++) {
if (j > 11){
while (headers[i][j] == null) ... // or here ArrayIndexOutOfBoundsException
건배!
관련 문제
- 1. 에 의해 발생 : org.springframework.beans.factory.NoSuchBeanDefinitionException :
- 2. 에 의해 발생 : java.lang.NoClassDefFoundError가 :
- 3. 에 의해 발생 : java.lang.NullPointerException이
- 4. 에 의해 발생 : com.mysql.jdbc.exceptions.jdbc4.CommunicationsException
- 5. 에 의해 발생 : org.apache.solr.common.SolrException : 찾을 수 없음
- 6. 에 의해 발생 :에서 java.lang.UnsatisfiedLinkError : com.android.tools.fd.runtime.IncrementalClassLoader $ DelegateClassLoader
- 7. 에 의해 발생 : java.lang.IllegalArgumentException : '_id'열이 없습니다.
- 8. 에 의해 발생 : java.lang.UnsupportedOperationException가 : 타입 = 0x12를 안드로이드
- 9. 에 의해 발생 : java.lang.IllegalArgumentException가 : 업체 == null이
- 10. 에 의해 발생 : org.eclipse.swt.SWTException : 잘못된 스레드 액세스
- 11. 에 의해 발생 : java.lang.NullPointerException이 : 안드로이드 스튜디오에 의해 잠금 == null이
- 12. java.lang.ArrayIndexOutOfBoundsException?
- 13. java.lang.ArrayIndexOutOfBoundsException
- 14. "javax.swing.JTabbedPane"에 탭을 추가하고있는 동안 "java.lang.ArrayIndexOutOfBoundsException : -1"
- 15. java.lang.NullPointerException에 의해 발생
- 16. 에 의해 발생 : com.google.gson.stream.MalformedJsonException : 1 행 21 열의 예상 EOF가
- 17. 에 의해 발생 : java.lang.ClassNotFoundException : 내 응용 프로그램을 시작한 후
- 18. 에 의해 발생 : org.hibernate.MappingException : @RevisionEntity로 하나의 엔터티에 주석을 달 수있다.
- 19. 에 의해 발생 : com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException : 인식 할 수없는 필드 "상태"
- 20. 에 의해 발생 : org.springframework.context.NoSuchMessageException : 코드 아래에 메시지가 없습니다.
- 21. SQLSTATE [HY000] [2002] 연결이 거부 -에 의해 발생 : PDOException
- 22. Perl의 system()이 "일시 중지됨". $ ARGV []에 의해 발생 했습니까?
- 23. 에 의해 발생 :에서 java.lang.UnsatisfiedLinkError :로드 할 수 없습니다 라이브러리
- 24. 에 의해 발생 : java.lang.IllegalArgumentException : org.hibernate.hql.internal.ast.QuerySyntaxException : 속성을 확인할 수 없습니다 :
- 25. 에 의해 발생 : android.database.sqlite.SQLiteException : 안드로이드에서 sqlite에 그런 테이블이 없다
- 26. 이상한 java.lang.ArrayIndexOutOfBoundsException
- 27. WebServer 8 베타에서 응용 프로그램 시작 오류 발생 : java.lang.ArrayIndexOutOfBoundsException
- 28. Java Xerces java.lang.ArrayIndexOutOfBoundsException : 8192
- 29. pyplot.ginput()에 의해 축이 변경됩니까?
- 30. 스크립트에 의해 발생 된 경고
어떤 라인이 해당 라인을 찾을 수 있도록 logcat을 게시하시기 바랍니다. –
LogCat please? 그렇지 않으면 코드에 오류가있을 수 있습니다. –
http://stackoverflow.com/questions/how-to-ask – JimmyB