Custom Adapter for List View

This is a class I had used for my project. You need to have a collection of your items which you want to display, in my case it’s <Item>. You need to override View getView(int position, View convertView, ViewGroup parent) method. R.layout.itemlistrow defines the row of the ListView. In the MainActivity define ListViewlike this,

Android Studio SDK location

Download the SDK from here: http://developer.android.com/sdk/ to C:\android-sdk\. Then when you launch Android Studio again, it will prompt you for the SDK path just point it to: C:\android-sdk\. Update: new download location, https://developer.android.com/studio/#command-tools

“ArrayAdapter requires the resource ID to be a TextView” XML problems

The ArrayAdapter requires the resource ID to be a TextView XML exception means you don’t supply what the ArrayAdapter expects. When you use this constructor: R.Layout.a_layout_file must be the id of a xml layout file containing only a TextView(the TextView can’t be wrapped by another layout, like a LinearLayout, RelativeLayout etc!), something like this: If you want your list row layout to be something a little different … Read more

How to resolve the “ADB server didn’t ACK” error?

Try the following: Close Eclipse. Restart your phone. End adb.exe process in Task Manager (Windows). In Mac, force close in Activity Monitor. Issue kill and start command in \platform-tools\ C:\sdk\platform-tools>adb kill-server C:\sdk\platform-tools>adb start-server If it says something like ‘started successfully’, you are good.

Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat

Run gradle -q dependencies (or gradle -q :projectName:dependencies) to generate a dependency report. You should see where r7 is coming from, such as: Then, use the exclude directive to block that dependency. In my case, it is coming from my CWAC-Camera library, and so I use: (where the second compile statement indicates what version you … Read more

Getting warning “NDK is missing a ‘platforms” directory.’ with no NDK

Please refer to these two links: How to fix android studios 2.3 NDK bug? https://github.com/requery/requery/issues/467 This is caused by upgrading to Android gradle plugin 2.3 (com.android.tools.build:gradle:2.3.0). In previous versions of the plugin the databinding package name (where the BR file is generated) was provided on an annotation in a generate file. In the new version … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)