Hehe sorry, I copied and pasted the code from the thread that you sent the link of:
import android.app.Activity;
import android.content.Context;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
import android.text.Editable;
import android.graphics.Color;
import android.widget.Toast;
import android.os.Looper;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.os.Bundle;
import android.widget.EditText;
EditText edit;
Activity act;
Context mC;
FrameLayout fl;
@Override
public void onStart() {
super.onStart();
act = this.getActivity();
mC= act.getApplicationContext();
//show or hide the keyboard at start
act.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
edit = new EditText(mC);
edit.setLayoutParams(new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.MATCH_PARENT
));
edit.setHint(" YOU CAN WRITE!");
edit.setTextColor(Color.rgb(200,0,0));
edit.setBackgroundColor(Color.WHITE);
edit.requestFocus();
fl = (FrameLayout)act.findViewById(0x1000);
fl.addView(edit);
}
void setup(){
size(600,900);
orientation(LANDSCAPE);
background(255,0,0);
Looper.prepare();
}
void draw(){
String txt = edit.getText().toString();//i you want to save it or transform it
println(txt);
}
public void onResume(){
super.onResume();
//show the softinput keyboard at start
act.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
}
For right now, I’m just using this to see how the Android EditText widget actually works because I have no idea how to use it. I’m trying to replace the textfield that I got from control P5. Thanks again!