Android: Adding text from textView to status bar

后端 未结 3 885
轮回少年
轮回少年 2020-12-18 14:20

Is it possible to add the String taken from textView to Status Bar. I want to show text constantly , dynamically updated as textView from apps main activity.



        
3条回答
  •  有刺的猬
    2020-12-18 14:39

    TextView message = (TextView) findViewById(R.id.textView1); message.setText("This I want to add to status bar");

    ActionBar actionBar = getSupportActionBar(); actionBar.setTittle(message.getText().toString());

    That should fix your problem.

提交回复
热议问题