[Android] Please tell me how to make the title bar visible in the 'Processing App'. help me

Please tell me how to make the title bar visible in the ‘Processing App’.

hello.

  1. Please look at the picture.
  2. In the ‘Title Bar’, you can see the current time and battery information.
  3. However, it cannot be checked in ‘Processing App’.
  4. How to make the ‘Title Bar’ visible in the ‘Processing App’?

help me.

Look in your manifest file. There is a line which calls for ‘noActionBar’; I tried REMMing that line out but the runtime just re-inserts it by default. In order to change this we would have to locate the source code for the editor that generates the manifest file and tell it not to add that (which I don’t know how to do). The other option is to use another editor, eg Android Studio and see if it installs the actionBar automatically; I’ve heard that it (or some other editor) does that.

This would be the perfect opportunity to add your own toolbar, but I’m not sure whether you’re interested in doing that or would rather have the original. If you want to make your own, the following link describes how to do it:
https://developer.android.com/develop/ui/views/components/appbar

1 Like

@svan

thank you for the reply.
I’m not sure if I understood that well. Can we understand that it cannot be solved in a ‘processing tool’?

As it turns out it is possible to place an actionBar in an Android window. The following code puts up a toolbar on my Samsung tablet. I did change the manifest.xml file also to leave out the ‘NoActionBar’ parameter. The toolbar is blank so you’ll have to figure out what you want on it. The source code for the action bar and changes to the manifest file are shown below:

import android.app.Activity;
import android.content.Context;
import android.app.ActionBar;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toolbar;

Activity activity;
Context ctx;
Toolbar tbar;

void setup() {
  activity = this.getActivity();
  ctx = activity.getApplicationContext();
  tbar = new Toolbar(ctx);
  activity.setActionBar(tbar);
  ActionBar actionBar = activity.getActionBar(); 
  println("actionBar: ",actionBar);
  actionBar.show();
}

void draw() {  
}

manifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package=""
          android:versionCode="1"
          android:versionName="1.0">
    <application android:label=""
                 android:icon="@mipmap/ic_launcher">
        <activity android:name=".MainActivity"
                  android:theme="@style/Theme.AppCompat.Light">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity> 
    </application>
</manifest>

Note that .NoActionBar.FullScreen was deleted from android:theme.

2 Likes

@svan
Thank you very much for your reply.

  1. ‘Processing’ ‘Android Mode for Processing4’
    : It works fine.

  2. ‘Processing’ ‘Android Mode for Processing3’
    : It is not reflected. Apparently, it seems to be a ‘AndroidManifest.xml’ problem. No error appears, but the title bar is not applied.