本文整理匯總了Java中android.widget.ListView.setScrollingCacheEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java ListView.setScrollingCacheEnabled方法的具體用法?Java ListView.setScrollingCacheEnabled怎麽用?Java ListView.setScrollingCacheEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.ListView
的用法示例。
在下文中一共展示了ListView.setScrollingCacheEnabled方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: show
import android.widget.ListView; //導入方法依賴的package包/類
public void show(String searchName,ArrayList<String> filePathList){
// タイトル
String strTitle = searchName+"駅を検索";
// リストビュー
ListView listview = new ListView( m_parent );
listview.setScrollingCacheEnabled( false );
listview.setOnItemClickListener( this );
// ファイルリスト
List<FileInfo> listFileInfo = new ArrayList<>();
for( String filePath : filePathList ){
File file=new File(filePath);
if(!file.exists()){
continue;
}
System.out.println(filePath);
if(file.getName().endsWith(".oud")||file.getName().endsWith(".oud2")) {
String[] stationName=loadStartEndStation(file);
listFileInfo.add(new FileInfo(stationName[0]+"~"+stationName[1]+"\n"+file.getName(),file));
}
}
Collections.sort( listFileInfo );
m_fileinfoarrayadapter = new FileInfoArrayAdapter( m_parent, listFileInfo );
listview.setAdapter( m_fileinfoarrayadapter );
Builder builder = new AlertDialog.Builder( m_parent );
builder.setTitle( strTitle );
builder.setNeutralButton("キャンセル", null );
builder.setView( listview );
m_dlg = builder.show();
}
示例2: onCreate
import android.widget.ListView; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
if (!QMail.isHideSpecialAccounts()) {
createSpecialAccounts();
}
List<Account> accounts = Preferences.getPreferences(this).getAccounts();
Intent intent = getIntent();
//onNewIntent(intent);
// see if we should show the welcome message
if (ACTION_IMPORT_SETTINGS.equals(intent.getAction())) {
onImport();
} else if (accounts.size() < 1) {
WelcomeMessage.showWelcomeMessage(this);
finish();
return;
}
if (UpgradeDatabases.actionUpgradeDatabases(this, intent)) {
finish();
return;
}
boolean startup = intent.getBooleanExtra(EXTRA_STARTUP, true);
if (startup && QMail.startIntegratedInbox() && !QMail.isHideSpecialAccounts()) {
onOpenAccount(mUnifiedInboxAccount);
finish();
return;
} else if (startup && accounts.size() == 1 && onOpenAccount(accounts.get(0))) {
finish();
return;
}
requestWindowFeature(Window.FEATURE_PROGRESS);
mActionBar = getActionBar();
initializeActionBar();
setContentView(R.layout.accounts);
ListView listView = getListView();
listView.setOnItemClickListener(this);
listView.setItemsCanFocus(false);
listView.setScrollingCacheEnabled(false);
registerForContextMenu(listView);
if (icicle != null && icicle.containsKey(SELECTED_CONTEXT_ACCOUNT)) {
String accountUuid = icicle.getString("selectedContextAccount");
mSelectedContextAccount = Preferences.getPreferences(this).getAccount(accountUuid);
}
restoreAccountStats(icicle);
mHandler.setViewTitle();
// Handle activity restarts because of a configuration change (e.g. rotating the screen)
mNonConfigurationInstance = (NonConfigurationInstance) getLastNonConfigurationInstance();
if (mNonConfigurationInstance != null) {
mNonConfigurationInstance.restore(this);
}
ChangeLog cl = new ChangeLog(this);
if (cl.isFirstRun()) {
cl.getLogDialog().show();
}
}