Codota Logo
Activity.setTitle
Code IndexAdd Codota to your IDE (free)

How to use
setTitle
method
in
android.app.Activity

Best Java code snippets using android.app.Activity.setTitle (Showing top 20 results out of 315)

  • Common ways to obtain Activity
private void myMethod () {
Activity a =
  • Codota IconWeakReference mActivity;mActivity.get()
  • Codota IconStack activityStack;activityStack.lastElement()
  • Codota Icon(Activity) param.thisObject
  • Smart code suggestions by Codota
}
origin: square/dagger

 public void setTitle(CharSequence title) {
  activity.setTitle(title);
 }
}
origin: cymcsg/UltimateAndroid

@Override
public void onReceivedTitle(WebView view, String title) {
  ((Activity) mContext).setTitle(title);
}
origin: stackoverflow.com

 getWindow().requestFeature(Window.FEATURE_PROGRESS);

WebView mWebView = (WebView) findViewById(R.id.mywebview);

mWebView.getSettings().setJavaScriptEnabled(true);

final Activity activity = this;

mWebView.setWebChromeClient(new WebChromeClient(){

     public void onProgressChanged(WebView view, int progress) {
         activity.setTitle("Loading...");
         activity.setProgress(progress * 100);
          if(progress == 100)
            activity.setTitle("My title");
         }
});

mWebView.loadUrl(URL);
origin: stackoverflow.com

mActivity .setTitle("Loading...");
mActivity .setProgress(progress * 100); //Make the bar disappear after URL is loaded
origin: stackoverflow.com

mActivity.setTitle(mModes[mModeIndex].toString());
origin: com.uphyca/android-junit4-robolectric

/**
 * @param titleId
 * @see android.app.Activity#setTitle(int)
 */
public void setTitle(int titleId) {
  mActivity.setTitle(titleId);
}
origin: limpoxe/Android-Plugin-Framework

activity.setTitle(activity.getClass().getName());
origin: ximsfei/Android-plugin-support

  private void changeTitle(DynamicApkParser.Activity a, Activity activity) {
    if (a.info.labelRes != 0) {
      activity.setTitle(a.owner.resources.getString(a.info.labelRes));
    } else if (a.owner.applicationInfo.nonLocalizedLabel != null) {
      activity.setTitle(a.owner.applicationInfo.nonLocalizedLabel);
    } else if (a.owner.applicationInfo.labelRes != 0) {
      activity.setTitle(a.owner.resources.getString(a.owner.applicationInfo.labelRes));
    }
  }
}
origin: stackoverflow.com

 Activity activity = this.getActivity();
Toolbar toolbar = (Toolbar) activity.findViewById(R.id.detail_toolbar);
    if (toolbar != null) {
      activity.setTitle("Title");
    }

//toolbar.setTitle("Title"); did not give the same results
origin: Werb/GankWithZhihu

  @Override
  public void onReceivedTitle(WebView view, String title) {
    System.out.println("网页title:"+title);
    activity.setTitle(title);
    super.onReceivedTitle(view, title);
  }
});
origin: werbhelius/Werb

  @Override
  public void onReceivedTitle(WebView view, String title) {
    System.out.println("网页title:"+title);
    activity.setTitle(title);
    super.onReceivedTitle(view, title);
  }
});
origin: com.sdklite/sphere-hybrid-spi

@Override
public void onReceivedTitle(final WebView view, final String title) {
  final Context context = view.getContext();
  if (context instanceof Activity) {
    ((Activity) context).setTitle(title);
  }
}
origin: YarikSOffice/LanguageTest

public static void resetActivityTitle(Activity a) {
  try {
    ActivityInfo info = a.getPackageManager().getActivityInfo(a.getComponentName(), GET_META_DATA);
    if (info.labelRes != 0) {
      a.setTitle(info.labelRes);
    }
  } catch (NameNotFoundException e) {
    e.printStackTrace();
  }
}
origin: derry/delion

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    addPreferencesFromResource(R.xml.legal_information_preferences);
    getActivity().setTitle(R.string.legal_information_title);
  }
}
origin: AndBible/and-bible

public static void translateTitle(Activity activity) {
  if (isLocaleOverridden(activity)) {
    // http://stackoverflow.com/questions/22884068/troubles-with-activity-title-language
    try {
      int labelRes = activity.getPackageManager().getActivityInfo(activity.getComponentName(), 0).labelRes;
      activity.setTitle(labelRes);
    } catch (PackageManager.NameNotFoundException e) {
      e.printStackTrace();
    }
  }
}
origin: wasdennnoch/AndroidN-ify

@Override
public void onResume() {
  super.onResume();
  getActivity().setTitle(getArguments().getString(TITLE));
}
origin: wirasetiawan29/Android

/**
 * Updates the state of 2 control buttons in response to the current page index.
 */
private void updateUi() {
  int index = mCurrentPage.getIndex();
  int pageCount = mPdfRenderer.getPageCount();
  mButtonPrevious.setEnabled(0 != index);
  mButtonNext.setEnabled(index + 1 < pageCount);
  getActivity().setTitle(getString(R.string.app_name_with_index, index + 1, pageCount));
}
origin: derry/delion

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  addPreferencesFromResource(R.xml.physical_web_preferences);
  getActivity().setTitle(R.string.physical_web_pref_title);
  initPhysicalWebSwitch();
  initLaunchButton();
}
origin: wasdennnoch/AndroidN-ify

@Override
public void onResume() {
  super.onResume();
  getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
  if (mShowExperimental != ConfigUtils.showExperimental(ConfigUtils.getPreferences(getActivity()))) {
    getActivity().recreate();
  } else {
    getActivity().setTitle(R.string.app_name);
  }
}
origin: pylerSM/XInstaller

  @Override
  public void onStop() {
    getActivity().setTitle(oldTitle);
    ActionBar ab = getActivity().getActionBar();
    if (ab != null && oldTitle.equals(getString(R.string.app_name))) {
      ab.setDisplayHomeAsUpEnabled(false);
      ab.setHomeButtonEnabled(false);
    }
    getActivity().invalidateOptionsMenu();
    super.onStop();
  }
}
android.appActivitysetTitle

Popular methods of Activity

  • onCreate
  • getWindow
  • finish
  • onDestroy
  • onResume
  • findViewById
  • startActivity
  • getResources
  • startActivityForResult
  • onPause
  • getSystemService
  • getWindowManager
  • getSystemService,
  • getWindowManager,
  • runOnUiThread,
  • isFinishing,
  • getString,
  • onStop,
  • getApplicationContext,
  • onStart,
  • onOptionsItemSelected,
  • getPackageName

Popular in Java

  • Start an intent from android
  • requestLocationUpdates (LocationManager)
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    This mapper (or, data binder, or codec) provides functionality for converting between Java objects (
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now