kernelmaster kernelmaster - 22 days ago 7
Java Question

Convert value from edit text to byte

i've searched a lot now, but i didn't find anything, so i'll ask here.
This is the code i've got a the moment:

byte[] valueofet = (EditText)findViewById(R.id.edittext1);
String base64 = Base64.encodeToString(valueofet, Base64.DEFAULT);


The error Eclipse is giving me:

Type mismatch: cannot convert from EditText to byte[]


Can you help me?

Answer

Hmm, it seems you're new to JAVA as well.

Use:

EditText myEditText = (EditText)findViewById(R.id.edittext1);
String content = myEditText.getText().toString();    
Comments