voglio usare attività si estende ListActivity per PullToRefresh.But ho uso CustomActionBar Ecco perché utilizzando AppCompatActivity.How per risolvere questo issue.Thanks in AdvancedCome estende ListActivity dove AppCompatActivity in attività Android
public class CustomActionActivity extends ListActivity
public class PullToRefreshActivity extends ListActivity {
private LinkedList<String> mListItems;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.pull_to_refresh);
// Set a listener to be invoked when the list should be refreshed.
((PullToRefreshListView) getListView()).setOnRefreshListener(new PullToRefreshListView.OnRefreshListener() {
@Override
public void onRefresh() {
// Do work to refresh the list here.
new GetDataTask().execute();
}
});
mListItems = new LinkedList<String>();
mListItems.addAll(Arrays.asList(mStrings));
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, mListItems);
setListAdapter(adapter);
}
Invece di questo:
public class CustomActionActivity extends AppCompatActivity
Mi dispiace ma ho difficoltà a capire la domanda. Puoi provare a chiarire? –
Nella mia attività, PullToRefresh non funziona correttamente, quindi desidero utilizzare ListActivity. Vedi ho modificato il mio post con PullToRefreshActivity. –
Considerare l'utilizzo di RecyclerView. Questa è la più recente api http://developer.android.com/reference/android/support/v7/widget/RecyclerView.html –