How can I parse a local JSON file from assets folder into a ListView?

I’m currently developing a physics app that is supposed to show a list of formulas and even solve some of them (the only problem is the ListView) This is my main layout <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:measureWithLargestChild=”false” android:orientation=”vertical” tools:context=”.CatList” > <RelativeLayout android:layout_width=”match_parent” android:layout_height=”wrap_content” android:background=”@drawable/titlebar” > <TextView android:id=”@+id/Title1″ android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_centerHorizontal=”true” android:layout_centerVertical=”true” android:text=”@string/app_name” android:textAppearance=”?android:attr/textAppearanceLarge” android:textColor=”#ff1c00″ … Read more

Android: disabling highlight on listView click

I want to disable the orange highlight that occurs when touching a listView row. So far in my xml I have tried the following: android:focusable=”false” android:focusableInTouchMode=”false” android:clickable=”false” More information: I want there to be zero difference when a user touches the screen on this listView object. 15 Answers 15

How can I put a ListView into a ScrollView without it collapsing?

I’ve searched around for solutions to this problem, and the only answer I can find seems to be “don’t put a ListView into a ScrollView”. I have yet to see any real explanation for why though. The only reason I can seem to find is that Google doesn’t think you should want to do that. … Read more

How to set space between listView Items in Android

I tried to use marginBottom on the listView to make space between listView Item, but still the items are attached together. Is it even possible? If yes, is there a specific way to do it? My code is below <LinearLayout android:id=”@+id/alarm_occurences” android:layout_width=”fill_parent” android:orientation=”vertical” android:layout_height=”fill_parent” android:background=”#EEEEFF” xmlns:android=”http://schemas.android.com/apk/res/android”> <ListView android:id=”@+id/occurences” android:layout_width=”fill_parent” android:layout_height=”fill_parent” /> </LinearLayout> My custom List … Read more