Android documentation said: This method was deprecated in API level 11.
This is code:
class GridViewActivity_ extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.gridview);
GridView gv = (GridView)findViewById(R.id.gridview);
Cursor c = managedQuery(Contacts.CONTENT_URI,
null, null, null, Contacts.DISPLAY_NAME);
String[] cols = new String[]{Contacts.DISPLAY_NAME};
int[] views = new int[] {android.R.id.text1};
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_1,
c, cols, views);
gv.setAdapter(adapter);
}
}
How replace this code , not deprecated code?
For activity, not fragment...