este codigo esta bastante deprecated pode atualizar android studio flamingo :package com.example.socorre

import android.app.ListActivity
import android.app.LoaderManager
import android.content.CursorLoader
import android.content.Intent
import android.content.Loader
import android.database.Cursor
import android.net.Uri
import android.os.Bundle
import android.view.View
import android.widget.ListView
import android.widget.SimpleCursorAdapter


class ShowActivity : ListActivity(),
    LoaderManager.LoaderCallbacks<Cursor> {
    private var adapter: SimpleCursorAdapter? = null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.showactivity)
        val columns = arrayOf(EstadosProvider.ESTADO)
        val toIds = intArrayOf(android.R.id.text1)
        loaderManager.initLoader(0, null, this)
        adapter = SimpleCursorAdapter(
            this,
            android.R.layout.simple_list_item_1, null, columns, toIds, 0
        )
        listAdapter = adapter
    }

    override fun onCreateLoader(
        id: Int,
        args: Bundle
    ): Loader<Cursor> {
        val projection = arrayOf(
            EstadosProvider.ID,
            EstadosProvider.ESTADO, EstadosProvider.SIGLA
        )
        return CursorLoader(
            this,
            EstadosProvider.CONTENT_URI, projection, null, null, null
        )
    }

    @Deprecated("Deprecated in NAME_1")
    override fun onLoadFinished(loader: Loader<Cursor>, data: Cursor) {
        adapter!!.swapCursor(data)
    }

    @Deprecated("Deprecated in NAME_1")
    override fun onLoaderReset(loader: Loader<Cursor>) {
        adapter!!.swapCursor(null)
    }

    override fun onListItemClick(l: ListView, v: View, position: Int, id: Long) {
        super.onListItemClick(l, v, position, id)
        val intent = Intent(this, MaintainActivity::class.NAME_1)
        val uri = Uri.parse(EstadosProvider.CONTENT_URI.toString() + "/" + id)
        intent.putExtra(EstadosProvider.CONTENT_ITEM_TYPE, uri)
        startActivity(intent)
    }
}