Questions tagged [android-view]

Questions regarding Views in Android. Views may be defined in Android Layout XML or in Java code. Questions using this tag involve general View practices or advice. With regard to specific Views, refer to the info for this tag. For questions regarding layout, use the [android-layout] tag.

Introduction

A View in Android is the display of the data utilized by the application. Views range widely from simple and non-interactive to complex and interactive in many ways. In addition to the Views provided by the SDK, developers have the option to create custom Views. This means that virtually any communication or display to the user may be handled in innumerable ways.

ViewGroups

ViewGroup is a subclass of View, which has the ability to hold other Views. Children Views may be added to the ViewGroup at run-time (in Java code) or may be pre-defined in Android XML. Like Views, ViewGroups may also be extended in the same way. Follow these guidelines for questions regarding ViewGroups:

  • If the ViewGroup is provided by the Android SDK, it should be listed below in Standard Views.
  • If the ViewGroup is a Custom View, use

Standard Views

A wide variety of Views are delivered with the Android SDK for use by developers. These views make up a majority of the Views in a standard application. Each View has its own semantics and behaviors. As a result, it is often more beneficial to use the tags specifically related to those Views. Below is a list of standard views provide within the Android SDK:

Usage: vs.

While Views and layouts work hand-in-hand, questions regarding the two are often very different. These guidelines will help to properly determine which tag to use:

  • If the question refers to the properties used to display the View properly, then use .
  • If, instead, the question refers to the functionality of the View, then is appropriate.
3981 questions
1
vote
0 answers

Issue with starting an activity from activityManager

I am working on an android project, where i have got a list view to be populated. It happens in a group activity where intent is passed to a controller and from that controller the activity starts using specified intent. In identifying the issue…
Usama Sarwar
  • 8,922
  • 7
  • 54
  • 80
1
vote
1 answer

Re drawing a view on orientation change

I am using aTextView in a ViewGroup and I am using that ViewGroup to create a gallery like scrollable UI. The TextView has its entire background filled with a single color. All is working fine except that when I change my orientation from portrait…
1
vote
3 answers

How to put a View in a determinate pixel/position

I need to put a view (a image for example) in a custom point of the interface. Are there a method to put a view in a exact pixel / virtual pixel (dp) - zone of the screen? I need that the view is displayed above the other views. I think to…
Aracem
  • 7,227
  • 4
  • 35
  • 72
1
vote
2 answers

Android - How to set typeface to bold on clicking a list item

I am trying to set a row to bold on clicking it. But it gives me a ClassCastException when I try to convert view into TextView like the following - setListAdapter(adapter); final ListView lv =…
Suchi
  • 9,989
  • 23
  • 68
  • 112
1
vote
1 answer

Discover the current position of a View after some transformations are aplied

I did this to scale a view: child.setPivotX(200); child.setPivotY(150); child.setScaleX(2); child.setScaleY(2); The View is scaled but I'm trying to get it's new position on screen and it's never…
Marcos Vasconcelos
  • 18,136
  • 30
  • 106
  • 167
1
vote
1 answer

Text shows up dim (initially) when trying to make a gallery of layouts

I am trying to make a gallery that functions similar to the android market where you can scroll (left/right) to view free or paid apps and etc... Also be able to scroll up and down through a layout. So far I just have it loading two layouts that…
ThinkNovelty
  • 135
  • 1
  • 7
1
vote
0 answers

Using viewholder with cursor adapter

I'm searching for a proper tutorial on how to use the viewholders along with cursor adapter. Mostly all tutorials are provided for ArrayAdapter.If the same is adopted for cursor adapter it is bit messy. can anyone explain the same. thanks in…
siva
  • 1,429
  • 3
  • 26
  • 47
1
vote
1 answer

Make FrameLayout expands, and it's childs also

How can I change the size of a FrameLayout dynamically and it's childs get expanded too? EDIT: So far, I got this but doesn't work: public class ResizableArea extends FrameLayout { private View child; public ResizableArea(Context context)…
Marcos Vasconcelos
  • 18,136
  • 30
  • 106
  • 167
1
vote
1 answer

Preventing browser loop

I've created an app that opens when clicking a specific URL. Obviously I've got something like this:
ajwest
  • 258
  • 7
  • 17
1
vote
1 answer

In Email compose, I want design inputs for yahoo like feature in android

In Email compose, when user types/selects email ids in to/cc/bcc. Suppose there are 7-8 email ids and now user want to delete 3rd one. It is very difficult for user to go to 3rd one and delete that one. So I think solution for this is, User enters…
Sagar
  • 1,242
  • 7
  • 22
  • 49
1
vote
0 answers

can we make horizontal scroll view infinte or loop around

I want to make horizontal scroll view infinite or atleast give the effect of being infinite. Any idea how to do so? can we listen to android horizontal scroll view as to when screen is scrolled.Is there any callback method that is called? Can we…
Gaurav
  • 667
  • 2
  • 13
  • 28
1
vote
2 answers

generic function to traverse a View hierarchy and find contained Views of a specific type

My outer problem, in Java 1.8, is I want to traverse (or spider) a tree of View objects and call a callback on each one of a specific type. Here's an example caller: findEachView(main.popupForm, (EditText v) -> { CharSequence…
Phlip
  • 5,253
  • 5
  • 32
  • 48
1
vote
1 answer

What is mLeft and mRight showing in hierarchyViewer?

I'm trying to see my view properties using hierarchyviewer tool. My first problem is that my view seems to be invisible although I didn't do anything to make it invisible. My second problem is I see to values, mRight and mLeft which I expect to be…
ikbal
  • 1,844
  • 4
  • 26
  • 46
1
vote
2 answers

Expand two TextViews next to each other

I would like to put two TextViews next to each other and let both of them expand depending on their contents. The contents of both TextViews are fully dynamic and unpredictable, therefore I want the solution to work consistently in all the cases…
Andrzej Zabost
  • 1,387
  • 11
  • 26
1
vote
1 answer

How to remove unwanted padding from self made canvas view in Android

I have a custom made Canvas object in Android (thermometer) that unfortunately has a padding around it that I want to get rid of as it makes it quite difficult to position it within the layout. Here is how it looks like: Here is the code of the…
VanessaF
  • 515
  • 11
  • 36