Tabnine Logo
ActivityChooserModel$HistoricalRecord.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.actionbarsherlock.widget.ActivityChooserModel$HistoricalRecord
constructor

Best Java code snippets using com.actionbarsherlock.widget.ActivityChooserModel$HistoricalRecord.<init> (Showing top 6 results out of 315)

origin: com.willowtreeapps/oak-demos

/**
 * Sets the default activity. The default activity is set by adding a
 * historical record with weight high enough that this activity will
 * become the highest ranked. Such a strategy guarantees that the default
 * will eventually change if not used. Also the weight of the record for
 * setting a default is inflated with a constant amount to guarantee that
 * it will stay as default for awhile.
 *
 * @param index The index of the activity to set as default.
 */
public void setDefaultActivity(int index) {
  ActivityResolveInfo newDefaultActivity = mActivites.get(index);
  ActivityResolveInfo oldDefaultActivity = mActivites.get(0);
  final float weight;
  if (oldDefaultActivity != null) {
    // Add a record with weight enough to boost the chosen at the top.
    weight = oldDefaultActivity.weight - newDefaultActivity.weight
      + DEFAULT_ACTIVITY_INFLATION;
  } else {
    weight = DEFAULT_HISTORICAL_RECORD_WEIGHT;
  }
  ComponentName defaultName = new ComponentName(
      newDefaultActivity.resolveInfo.activityInfo.packageName,
      newDefaultActivity.resolveInfo.activityInfo.name);
  HistoricalRecord historicalRecord = new HistoricalRecord(defaultName,
      System.currentTimeMillis(), weight);
  addHisoricalRecord(historicalRecord);
}
origin: com.actionbarsherlock/actionbarsherlock

/**
 * Sets the default activity. The default activity is set by adding a
 * historical record with weight high enough that this activity will
 * become the highest ranked. Such a strategy guarantees that the default
 * will eventually change if not used. Also the weight of the record for
 * setting a default is inflated with a constant amount to guarantee that
 * it will stay as default for awhile.
 *
 * @param index The index of the activity to set as default.
 */
public void setDefaultActivity(int index) {
  ActivityResolveInfo newDefaultActivity = mActivites.get(index);
  ActivityResolveInfo oldDefaultActivity = mActivites.get(0);
  final float weight;
  if (oldDefaultActivity != null) {
    // Add a record with weight enough to boost the chosen at the top.
    weight = oldDefaultActivity.weight - newDefaultActivity.weight
      + DEFAULT_ACTIVITY_INFLATION;
  } else {
    weight = DEFAULT_HISTORICAL_RECORD_WEIGHT;
  }
  ComponentName defaultName = new ComponentName(
      newDefaultActivity.resolveInfo.activityInfo.packageName,
      newDefaultActivity.resolveInfo.activityInfo.name);
  HistoricalRecord historicalRecord = new HistoricalRecord(defaultName,
      System.currentTimeMillis(), weight);
  addHisoricalRecord(historicalRecord);
}
origin: com.actionbarsherlock/actionbarsherlock

HistoricalRecord historicalRecord = new HistoricalRecord(chosenName,
    System.currentTimeMillis(), DEFAULT_HISTORICAL_RECORD_WEIGHT);
addHisoricalRecord(historicalRecord);
origin: com.actionbarsherlock/actionbarsherlock

  Float.parseFloat(parser.getAttributeValue(null, ATTRIBUTE_WEIGHT));
HistoricalRecord readRecord = new HistoricalRecord(activity, time,
    weight);
readRecords.add(readRecord);
origin: com.willowtreeapps/oak-demos

  Float.parseFloat(parser.getAttributeValue(null, ATTRIBUTE_WEIGHT));
HistoricalRecord readRecord = new HistoricalRecord(activity, time,
    weight);
readRecords.add(readRecord);
origin: com.willowtreeapps/oak-demos

HistoricalRecord historicalRecord = new HistoricalRecord(chosenName,
    System.currentTimeMillis(), DEFAULT_HISTORICAL_RECORD_WEIGHT);
addHisoricalRecord(historicalRecord);
com.actionbarsherlock.widgetActivityChooserModel$HistoricalRecord<init>

Javadoc

Creates a new instance.

Popular methods of ActivityChooserModel$HistoricalRecord

    Popular in Java

    • Start an intent from android
    • getSupportFragmentManager (FragmentActivity)
    • putExtra (Intent)
    • scheduleAtFixedRate (ScheduledExecutorService)
    • String (java.lang)
    • HttpURLConnection (java.net)
      An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
    • KeyStore (java.security)
      KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
    • ArrayList (java.util)
      ArrayList is an implementation of List, backed by an array. All optional operations including adding
    • HttpServlet (javax.servlet.http)
      Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
    • BasicDataSource (org.apache.commons.dbcp)
      Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
    • From CI to AI: The AI layer in your organization
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now