zoukankan      html  css  js  c++  java
  • android 悬浮覆盖状态栏的相关建议

      WindowManager.LayoutParams.TYPE_SYSTEM_ERROR 显示在所有的应用之上包括显示在状态栏上,相对于TYPE_SYSTEM_OVERLAY不能获取焦点更为理想。

      另获取状态栏大小的方法可以使用如下方式:  

    1 public static int getStatusBarHeight(Context context) {
    2   int result = 0;
    3   int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
    4         if (resourceId > 0) {
    5       result = context.getResources().getDimensionPixelSize(resourceId);
    6         }
    7         return result;
    8     }

      发送邮箱信息可以如下显示:

     public static void sendEmail(Context context, String recipient) {
         sendEmail(context, new String[]{recipient}, null, null, null);
    }
    
    public static void sendEmail(Context context, String[] recipients, String subject, String text, Uri stream) {
        context.startActivity(createSendEmailIntent(recipients, subject, text, stream));
    }
    
    public static Intent createSendEmailIntent(String[] recipients, String subject, String text, Uri stream) {
      Intent i = new Intent(Intent.ACTION_SEND);
        i.setType("message/rfc822");
        if (recipients != null) {
        i.putExtra(Intent.EXTRA_EMAIL, recipients);
        }
        i.putExtra(Intent.EXTRA_SUBJECT, subject);
      if (!TextUtils.isEmpty(text)) {
        i.putExtra(Intent.EXTRA_TEXT, text);
      }
      if (stream != null) {
        i.putExtra(Intent.EXTRA_STREAM, stream);
      }
      return i;
    }
  • 相关阅读:
    FineReport——函数
    FineReport——插入行策略
    FineReport——JS二次开发(CSS改变控件样式)
    FineReport——JS二次开发(下拉框)
    汽车系统
    Ubuntu Software setup
    Win 10 乱码 & 字体横过去了
    U-boot 2016.11 代码结构 dra7xx
    samba Ubuntu 16.04
    ftp Ubuntu16.04
  • 原文地址:https://www.cnblogs.com/toolbear/p/5134009.html
Copyright © 2011-2022 走看看