Android通知:如何在顶线中包含额外的文本

时间:2017-11-22 18:00:25

标签: android notifications android-notifications

这些是Android 7 +上的2个通知:


  • 在第一行显示:图标应用名称时间 enter image description here


  • 在第一行显示:图标应用名称额外文字(如果是Gmail,则为帐户电子邮件地址)和时间 enter image description here


任何人都可以解释如何在应用名称和通知时间之间加入额外文字,如Gmail通知中所示?

是否有argument is not numeric设置该文字的方法?

   int cont = 0;
   int num;

   public void number (){

        matrixnn = new int [10][10];

        num = Integer.parseInt(JOptionPane.showInputDialog("Pick a number from 10-20 "));

       for(int i = 0; i < matrixnn.length; i++ ){
           for (int j = 0; j < matrixnn[i].length; j++){

               matrixnn [i][j] = (int)(Math.random()*(20-10+1)+10);

               if(num == matriznx[i][j]){
                   cont++;    
               }   
            System.out.print(matrixnn[i][j]+" ");           
       }     
         System.out.println();
    }

        System.out.println("\nThe number selected "+num+" has been found "+cont+" times."); 
        System.out.println("  ");   
}

1 个答案:

答案 0 :(得分:1)

找到了答案!

它是潜台词:

.setSubText("text to show next to app name")