[Solved] Android App Crashing – List View – CSV file

[ad_1] Ok your program fails at this point: while ((line = reader.readLine()) != null) { String[] RowData = line.split(“,”); DataStates cur = new DataStates(); cur.setTitle(RowData[2]); cur.setPrice(RowData[3]); // now there is a ArrayIndexOutOfBoundsException cur.setDescription(RowData[4]); this.add(cur); } Index begins at 0 so I think the right code would be while ((line = reader.readLine()) != null) { String[] … Read more

[Solved] Null object reference error when trying to open new activity on Android? [duplicate]

[ad_1] You need to initialize your button, you are calling OnClickListener on null reference LoginButton =(Button)findViewById(R.id.button_login); Before calling LoginButton.setOnClickListener() initilize your login button. 6 [ad_2] solved Null object reference error when trying to open new activity on Android? [duplicate]

[Solved] GOOGLE SEARCH FROM TEXTVIEW IN ANDROID STUDIO 2.3.3

[ad_1] Let me get this straight. You want someone to use your app, type in a EditText, and when they click a button, it takes them to a browser and searches for the words they typed in? XML <TextView android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”Hello World!” android:textSize=”50dp” android:id=”@+id/textView” app:layout_constraintBottom_toBottomOf=”parent” app:layout_constraintLeft_toLeftOf=”parent” app:layout_constraintRight_toRightOf=”parent” app:layout_constraintTop_toTopOf=”parent” /> Java public class MainActivity extends … Read more

[Solved] How to handle a large number of activities in android studio

[ad_1] No, you don’t need that many activities. You need to write abstract activities that take parameters and displays different data based on those. At most I see 4 activities here- department selector, semester selector, subject selector, and the actual subject activity. And arguably some of those should be fragments instead, although that’s more personal … Read more

[Solved] Extracting a char from a string

[ad_1] You can’t parse a String which represents a Double with Integer.parseInt(). This will not work: Integer.parseInt(“3.0”); This will work: Integer.parseInt(“3”); Use this instead: new Double(“3.0”).intValue() But consider following behavior: new Double(“2.5”).intValue() will return 2. 2 [ad_2] solved Extracting a char from a string