Exemplo n.º 1
0
  /**
   * Make a standard hint that just contains a text view.
   *
   * @param context The context to use. Usually your {@link android.app.Application} or {@link
   *     android.app.Activity} object.
   * @param text The text to show. Can be formatted text.
   */
  public static OnScreenHint makeText(Context context, CharSequence text) {
    OnScreenHint result = new OnScreenHint(context);

    LayoutInflater inflate =
        (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View v = inflate.inflate(R.layout.onscreen_hint, null);
    TextView tv = (TextView) v.findViewById(R.id.message);
    tv.setText(text);

    result.mNextView = v;

    return result;
  }