basically I have a text view that displays the default status of the user
<TextView
android:id="@+id/clickable_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:onClick="editStatus"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:text="Online"/>
When I tap on this, the keyboard opens and it converts to an EditText. When this happens, there is a new button that appears that will say "Save Status". What I want is for this to do is when I tap the "Save Status" button, it will create a new text view, where the use inputted text will display. This is my code, but I've got red squigglies under new TextView(this) and linearLayout.
private OnClickListener keyboard = new OnClickListener() {
public void onClick(View v) {
// Hide Keyboard
InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(getCurrentFocus()
.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
// Hide EditText
EditText status = (EditText) findViewById(R.id.hidden_edit_view);
status.setVisibility(View.GONE);
// Get inputtes text
String text = status.getText().toString();
// Display text in TextView
LinearLayout layout = (LinearLayout) findViewById(R.id.contactlist);
TextView valueTV = new TextView(this);
valueTV.setText(text);
((LinearLayout) linearLayout).addView(valueTV);
layoutinstead oflinearLayout.)after linearLayout, but then it told me "Syntax error, insert "AssignmentOperator Expression" to complete Expression"