title: The constructor SimpleCursorAdapter(Context, int, Cursor, String[], int[]) is deprecated
body: <p>How to fix this problem?</p>
  
  <blockquote>
    <p>The constructor SimpleCursorAdapter(Context, int, Cursor, String[],
    int[]) is deprecated</p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>The method managedQuery(Uri, String[], String, String[], String) from
    the type Activity is deprecated</p>
  </blockquote>
  
  <p>Here's the code :</p>
  
  <pre><code>package com.example.kamusdigital;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.View;
  import android.app.SearchManager;
  import android.content.Context;
  import android.content.Intent;
  import android.database.Cursor;
  import android.net.Uri;
  import android.view.Menu;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  import android.widget.AdapterView;
  import android.widget.ListView;
  import android.widget.SearchView;
  import android.widget.SimpleCursorAdapter;
  import android.widget.TextView;
  import android.widget.AdapterView.OnItemClickListener;
  
  public class MainActivity extends Activity {
  
      private TextView munculTulisan;
      private ListView barisanKata;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          munculTulisan = (TextView) findViewById(R.id.tulisanMuncul);
          barisanKata = (ListView) findViewById(R.id.barisDemiBaris);
  
          mengaturIntent(getIntent());
      }
  
      @Override
      protected void onNewIntent(Intent intent) {        
          mengaturIntent(intent);
      }
  
      private void mengaturIntent(Intent intent) {
          if (Intent.ACTION_VIEW.equals(intent.getAction())) {
  
              Intent agarKataDptDiKlik = new Intent(this, TampilanKata.class);
              agarKataDptDiKlik.setData(intent.getData());
              startActivity(agarKataDptDiKlik);
              finish();
          } else if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
              String query = intent.getStringExtra(SearchManager.QUERY);
              hasilPencarian(query);
          }
      }
  
  
      private void hasilPencarian(String query) {
  
          Cursor cursor = managedQuery(PenghubungData.CONTENT_URI, null, null,
                                  new String[] {query}, null);
  
          if (cursor == null) {
              munculTulisan.setText(getString(R.string.tak_ada_hasil, new Object[] {query}));
          } else {
              int count = cursor.getCount();
              String countString = getResources().getQuantityString(R.plurals.hasil_pencarian,
                                      count, new Object[] {count, query});
              munculTulisan.setText(countString);
  
              String[] dari = new String[] { KamusDatabase.KATA,
                                             KamusDatabase.ARTI_NYA };
  
              int[] ke = new int[] { R.id.kolomKata,
                                     R.id.kolomArtinya };
  
              SimpleCursorAdapter letakanKataPadaTempatnya = new SimpleCursorAdapter(this,
                                            R.layout.hasil, cursor, dari, ke);
              barisanKata.setAdapter(letakanKataPadaTempatnya);
  
              barisanKata.setOnItemClickListener(new OnItemClickListener() {
                  public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
                      Intent kataDiKlik = new Intent(getApplicationContext(), TampilanKata.class);
                      Uri data = Uri.withAppendedPath(PenghubungData.CONTENT_URI,
                                                      String.valueOf(id));
                      kataDiKlik.setData(data);
                      startActivity(kataDiKlik);
                  }
              });
          }
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          MenuInflater perpanjangTampilan = getMenuInflater();
          perpanjangTampilan.inflate(R.menu.untuk_menu, menu);
  
          SearchManager mengaturSearch = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
          SearchView tampilanSearch = (SearchView) menu.findItem(R.id.cari).getActionView();
          tampilanSearch.setSearchableInfo(mengaturSearch.getSearchableInfo(getComponentName()));
          tampilanSearch.setIconifiedByDefault(false);
  
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
              case R.id.cari:
                  onSearchRequested();
                  return true;
              default:
                  return false;
          }
      }
  }
  </code></pre>
  
  <blockquote>
    <p></p>
  </blockquote>
  
  <pre><code>package com.example.kamusdigital;
  
  import android.app.ActionBar;
  import android.app.Activity;
  import android.app.SearchManager;
  import android.content.Context;
  import android.content.Intent;
  import android.database.Cursor;
  import android.net.Uri;
  import android.os.Build;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  import android.widget.SearchView;
  import android.widget.TextView;
  
  public class TampilanKata extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.kata);
  
          ActionBar tempatTampilKata = getActionBar();
          tempatTampilKata.setDisplayHomeAsUpEnabled(true);
  
          Uri uri = getIntent().getData();
          Cursor cursor = managedQuery(uri, null, null, null, null);
  
          if (cursor == null) {
              finish();
          } else {
              cursor.moveToFirst();
  
              TextView kataKata = (TextView) findViewById(R.id.kolomKata);
              TextView artinya = (TextView) findViewById(R.id.kolomArtinya);
  
              int indexKata = cursor.getColumnIndexOrThrow(KamusDatabase.KATA);
              int indexArtinya = cursor.getColumnIndexOrThrow(KamusDatabase.ARTI_NYA);
  
              kataKata.setText(cursor.getString(indexKata));
              artinya.setText(cursor.getString(indexArtinya));
          }
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          MenuInflater inflater = getMenuInflater();
          inflater.inflate(R.menu.untuk_menu, menu);
  
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.HONEYCOMB) {
          SearchManager aturPencarian = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
          SearchView tampilanPencarian = (SearchView) menu.findItem(R.id.cari).getActionView();
          tampilanPencarian.setSearchableInfo(aturPencarian.getSearchableInfo(getComponentName()));
          tampilanPencarian.setIconifiedByDefault(false);
          }
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
              case R.id.cari:
                  onSearchRequested();
                  return true;
              case android.R.id.home:
                  Intent intent = new Intent(this, MainActivity.class);
                  intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                  startActivity(intent);
                  return true;
              default:
                  return false;
          }
      }
  }
  </code></pre>