![]() ![]() If (resourceId > 0) statusBarHeight = getResources().getDimensionPixelSize(resourceId) įinal WindowManager.LayoutParams parameters = new WindowManager.LayoutParams( Int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android") I do found a solution, the keyword is overlay with a floating window. MNotifyMgr.notify(NOTIFICATION_ID, notification) NotificationManager mNotifyMgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE) Notification.flags |= Notification.FLAG_NO_CLEAR | Notification.FLAG_ONGOING_EVENT Notification notification = mBuilder.build() PendingIntent resultPendingIntent = PendingIntent.getActivity(this, 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT) Intent resultIntent = new Intent(this, MainActivity.class) NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar) Private final int NOTIFICATION_ID = void onCreate (Bundle savedInstanceState) Public class MainActivity extends AppCompatActivity Maybe an overlay is, but after searching I didn't find something.Ĭan someone show me how to do it or give me a hint, please?Įdit: Here my test code for NotificationCompat.Builder I already tried NotificationCombat.Builder, but I think this is not the right way. I know it is possible, because I saw it in a battery monitor app from play store. I added a sample image to show what exactly do I mean (red circle). So my problem is, I don't know how to show the text in the status bar. I'm trying to develop an app for Android Nougat and I want to show some info/text in the status bar generating from a android service routine. ![]()
0 Comments
Leave a Reply. |