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 9176719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:10:16+00:00 2026-06-17T17:10:16+00:00

Is there a view in android, that can store one object and display the

  • 0

Is there a view in android, that can store one object and display the object’s toString() return value like a TextView?

Or do I have to mimic the behaviour in taking a ListView and ensure that only one item is in its adapter?

I need this, because I use drag & drop to move objects around and I need a view, that can display and store one of the objects.

Thank you!

  • 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-17T17:10:17+00:00Added an answer on June 17, 2026 at 5:10 pm

    yes, there is such a view and you already mentioned it. it’s called TextView, and you’d use it like this,

    TextView tv = (TextView)findObjectById(R.id.tv);
    tv.setText(myObject.toString());
    

    if you don’t like like that, extend TextView like this,

    class ToStringView extends TextView { 
      ...
      public void setObject(Object o) { setText(o.toString()); }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there an open source Android application that allows you to view the image
I have a custom view that accepts drags. In the custom view there is
I have a View in Android that has an onTouchEvent which stores the x
I am new to android programming but there is something small that i can't
I have a class that I would like to store specific times in. The
In my android application there is a number of operations that the user can
Is there a way I can store/retrieve arbitrary values from a view, similar to
IS there any way that I can update a TextView when user click on
I was reading the Gallery View tutorial : http://developer.android.com/resources/tutorials/views/hello-gallery.html . Is there anyway I
I have a map view with annotations, and these annotations display a callout. When

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.