Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9203513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:29:24+00:00 2026-06-17T23:29:24+00:00

basically I have a text view that displays the default status of the user

  • 0

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);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:29:25+00:00Added an answer on June 17, 2026 at 11:29 pm

    You’re going to want to reference the outer class instead by doing:

    TextView valueTV = new TextView(YourActivity.this);
    

    Since when you use just this inside the inner class, you are referencing the inner class instance, which isn’t a Context, it’s an OnClickListener.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a view that displays a table: rows represent days - one row
I have (basically) this code - <script type=text/javascript language=javascript> $(document).ready(function() { $(#loadDiv).load(mypage.html, function(){ alert($(#someText).text())
Basically, I have an array of keywords, and a piece of text. I am
Okay, basically, I have a large list of phone numbers in a text file
I basically have a program that filters records from one excel file to another
I basically have 7 select statements that I need to have the results output
I have a list view that is displaying data using the gridview. This list
I have a dropdown in view that is using js I pass the selected
Basically I have a table in the index view where if a pictures name
Basically, I have a ListView of items. When one is selected, a text box

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.