Java Code Examples for android.widget.ListView.setScrollingCacheEnabled()

The following are Jave code examples for showing how to use setScrollingCacheEnabled() of the android.widget.ListView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: AOdia   File: SearchFileDialog.java   View Source Code Vote up 6 votes
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();
}
 
Example 2
Project: q-mail   File: Accounts.java   View Source Code Vote up 4 votes
@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();
    }
}