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.

android-view
Filter by
Sorted by
Tagged with
0 votes
4 answers
220 views

loading high amounts of views programmatically in android?

I have a for loop within a for loop within a for loop (3 for loops). Each for loop loads at least one view in them some load more than 1. All of the views(textviews, imageviews) are loaded into a ...
Marke's user avatar
  • 189
-2 votes
1 answer
800 views

How to map variable and view in android?

I have a list of objects, I set them to view and insert to layout But I don't know how to identify which view for which object Is it possible to add additional attribute to view before I insert it ...
CL So's user avatar
  • 3,727
2 votes
0 answers
386 views

How to bypass click events on a View in android?

Suppose I have a simple transperent View and an ImageView under it. The transparent View completely covers the ImageView. Now I want my ImageView to recieve click events, but since the View is ...
Prathmesh Deshmukh's user avatar
0 votes
1 answer
906 views

Position View above current layout but not above navigation bar and status bar

I was wondering is it possible to position View above current layout but not above navigation bar and status bar programmatically? I have tried this: MyView myView = new MyView(context) ViewGroup ...
user4386126's user avatar
  • 1,235
2 votes
2 answers
608 views

How to force View to recalculate it's position after changing parent

It has been some days since I have this problem. This is a reformulation of this question considering the behavior I describe on this answer. Please, note that this question states for a less ...
Luis Sieira's user avatar
  • 30.8k
1 vote
1 answer
147 views

Is it possible in ExpandableListView in Android to have different alignment for some children?

I've created an ExpandableListView and want few of my children to be aligned to the right instead of the left. I used the guide from here. Is it possible to align only specific rows? |Parent0 ...
Kamil's user avatar
  • 1,518
15 votes
2 answers
1k views

Trying to deselect a view using getChildAt()

I'm using a GridView inside an ExpandableListView I have a function that highlights an item when it is clicked, now I'm trying to implement a button that when pressed it will unselect all selected ...
AND4011002849's user avatar
0 votes
2 answers
81 views

Couldn't reposition views programatically in an Activity android

I have 5 buttons in an Activity with relative layout. I have a function called init() which will reposition the buttons using setX() and setY(). When I call init() from inside the onClickListener, ...
Harish Elumalai's user avatar
0 votes
1 answer
50 views

Scale imageview on left to imageview on right's height

I am trying to place two image views side by side with the one on the left having a height matching the one on the right. The problem is, the sizes of the image view files are much larger than how ...
user avatar
0 votes
2 answers
7k views

setVisibility(view.GONE) is not working Android

i need to disable the view programmatically so i used setVisibility(view.GONE) in activity. My xml have two buttons named lower and upper and two relative layouts named lower_lay and upper_lay.when ...
kartheeki j's user avatar
  • 2,286
0 votes
2 answers
258 views

Circular View with Button Press Effect

I am looking for a custom component to design a circular remote control view like the image below with different button and background color. Each button should be touchable with proper press effect....
Krishnakant Dalal's user avatar
0 votes
1 answer
490 views

how to update a customview according to the data change?

Currently in my android app, I made a custom view with 8 rect blocks in two different colors. What I want to do is to make the 8 rectangle update the colour according to a array change. Now my code ...
user824624's user avatar
  • 7,557
0 votes
0 answers
59 views

How to wrap background color for some widgets?

I want add background for a group of widgets First I tried to use View, the app will crash <View android:layout_width="match_parent" android:layout_height="wrap_content" android:...
CL So's user avatar
  • 3,727
18 votes
2 answers
7k views

How to vary between child and parent view group touch events

I decided to post this question and answer in response to this comment to this question: How to handle click in the child Views, and touch in the parent ViewGroups? I will paste the comment here: ...
user avatar
2 votes
1 answer
62 views

Data does not display properly in Adapter when Removing/Adding

I am running into an issue where I use 2 separate adapters, and 2 seperate GridViews (1 Adapter, for 1 GridView), and am basically removing items from either adapter, and adding it to the other if the ...
Coova's user avatar
  • 1,828
0 votes
2 answers
4k views

How to get a list of all views in a fragment?

I would like to get a list of all views inside a main Fragment, so that I could iterate through them in a for loop. Maybe something like this: for (View v : fragmentViews) {
HavenB3's user avatar
  • 129
0 votes
2 answers
793 views

how do i check if the edit text view contains 2 white spaces?

Currently my edit text view checks if the searched term contains one space as follows: if(mSearchView.getText().toString().contains(" ") How do I make it such that it makes sure it checks if the ...
user avatar
1 vote
2 answers
787 views

When I try to run an AsyncTask on a button click, I receive a fatal error "Could not find a method createView(View) in MainActivity"

I am attempting to POST to a SQL server upon the click of a confirmation button in my main activity. However, when I click the button I receive a fatal error: Could not find a method create(View) in ...
Connor O'Doherty's user avatar
0 votes
2 answers
811 views

Get ViewPager height and width in pixels only once inside Fragment

I know there are a lot of similar questions, but suggested solutions don't work in my case. What is my problem. I have fragment nested inside activity. Fragment layout includes ViewPager. What is my ...
CROSP's user avatar
  • 4,567
3 votes
3 answers
622 views

Can Activity classes be made launchable only during development/debug?

A common situation I face is that I wish to test a custom View visibly on screen while it is being developed as part of a large application. I realise that unit testing exists, particularly using ...
Trevor's user avatar
  • 11k
0 votes
2 answers
112 views

Decapitalizing text in Android view

I want to insert a text into an Android view, like a button. The problem is that I want the capitalize some specific characters in my text, but Android capitalize all the text I in the text field. For ...
The Dark Knight's user avatar
0 votes
1 answer
107 views

Unable to instantiate activity ComponentInfo starting my app [duplicate]

i'm getting this error when i launch my app, how can i solve this? 12112-12112/com.javacodegeeks.androidqrcodeexample E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.RuntimeException: ...
Jack_usti's user avatar
1 vote
0 answers
228 views

Replacing fragments quickly causes a weird screenshot of the previous fragment to persist and brought forward

I'm using a HomeActivity which replaces fragments dynamically and adds it to content frame layout dynamically as the user selected items from the drawer. On each fragment, it loads a feed from the ...
Rickster's user avatar
  • 1,403
0 votes
1 answer
4k views

Reset all Views in fragment

So I am currently in FragmentA.java, a class which consists of different EditTexts and Checkboxes for users to press and input. My question is, I have this reset button, how can I reset the entire ...
loneranger's user avatar
-2 votes
1 answer
102 views

Android 5.0 does not respect view's margins

I have an app that runs well in any version of android, but in Lollipop seems that all views don't respect any margin or padding. Does anyone know why?? Thanks in advance. I'm declaring the CardView ...
MauroL's user avatar
  • 21
0 votes
0 answers
358 views

Clone Views in Android

I need to define something like view classes at runtime in Android. May an example be a TextView with a defined text size and color (definition is not inside the app, it must be outside). Then I want ...
user2331454's user avatar
14 votes
1 answer
2k views

Two views with same elevation side-by-side

I have two views with the same elevation beside each other. My wanted behaviour is that they won't cast a shadow over each other as they have the same elevation, however, what is happening is that the ...
Daniel Julio's user avatar
  • 1,483
1 vote
2 answers
2k views

Detect when view is removed from Android ListView

I have a custom class that is used as a View for each item in a ListView. When the View initializes, it starts updating itself every second. Where can I detect that the view is being removed, and ...
Leah Sapan's user avatar
  • 3,701
1 vote
0 answers
307 views

Android Custom View (Table)

I have a problem figuring out how to create a custom android view that contains other views in it like a table. How can I create a method in that android custom view class for adding a view inside it, ...
user5819's user avatar
  • 544
0 votes
1 answer
39 views

what element to be used to display dynamic moving screens in android

what element to be used to display dynamic moving screens in android, what I want to do in my app is to show 3-4 screens to the user moving dynamically based on a predefined time interval of 2-3 ...
rahulfhp's user avatar
-1 votes
1 answer
461 views

Name of the UI used in the App present in playstore and how to achieve the same?

I am a newbee in Android development, I just want to know if anyone can tell me what the UI or View is which is used in the News In Short app (present in the play store). Can anyone provide a link (...
Pravinsingh Waghela's user avatar
0 votes
0 answers
66 views

Lazy View pager for a bunch of items

I need to have view pager for swiping between products (Fragments), when I click on any product from the list, I can swipe left or right for navigation to adjacent product. Is there any efficient way ...
cvpqnbro's user avatar
5 votes
2 answers
11k views

Difference between view.findViewById(R.id....) and just findViewById(R.id...)

I'm trying to implement a Custom Array Adapter , Problem is my code crashes when I use ImageView imageView=(ImageView)findViewById(R.id.imageView); rather than ImageView imageView=(ImageView)...
Sainath S.R's user avatar
  • 3,174
0 votes
1 answer
48 views

Android Current window check

How to make it properly? I mean, I need check what is current view, and change menu option depend on currernt view? Any ideas? @Override public boolean onCreateOptionsMenu(Menu menu) { ...
waclaw's user avatar
  • 433
3 votes
1 answer
1k views

How do I update my TextView in MainActivity after exiting a dialog fragment?

Currently, my main activity displays an arbitrary time, and holds a button that when pressed, brings up a Time Picker Dialog Fragment. After the user sets a new time in the Fragment, closing the ...
Connor O'Doherty's user avatar
1 vote
1 answer
1k views

ListView Shared Element Transition Issue

I am attempting to create shared element transition between two Activities. This appears to work find between two layouts, each containing a single ImageView. However, I am having issues getting this ...
user1927638's user avatar
  • 1,163
38 votes
3 answers
17k views

Difference between an AppCompat view and a normal Android view

What is the difference between an AppCompat view component and a standard/default view component? For example, the difference between an AppCompatEditText, and an EditText, or between an ...
Farbod Salamat-Zadeh's user avatar
0 votes
2 answers
64 views

What view is this and how can I implement it?

What view is this and how can I implement it?
Roach's user avatar
  • 611
3 votes
5 answers
6k views

How to create views dynamically from json in android listview? [closed]

I want to create radio button,checkbox,spinner dynamically from web service. Below is my response. { "getSurvey": { "ErrorCode": "0", "Result": "Success", "Response": [ ...
Shanmuga M's user avatar
3 votes
2 answers
466 views

Displaying different images form drawable without switching activities

As shown in the image each button click have different image, and I don't want to make different activities for view1, view2, view3 and view4 to show images: Question: I am new in Android app ...
Hareem Waqas's user avatar
1 vote
2 answers
1k views

Indeterminate ProgressBar with animation and rounded corners

How can an indeterminate progressbar be created that is animated, and has rounded corners? For some reason if you use your own animation-list as animation, the shape can't be defined. It will always ...
Miklos Jakab's user avatar
  • 2,034
1 vote
0 answers
270 views

Setting a background view animation for google card view

I'm writing an android app which uses romannurik`s Android-SwipeToDismiss. I'm using google cardview for my view items. Swiping the cards is enabled in the app using the above romannuriks library. ...
vijay rajendra Andukuri's user avatar
1 vote
1 answer
724 views

Update ListView footer

I've a ListView with a footer View that contains a TextView that can be changed dynamically according to the language selected. When I select a different language I update my ListView items: ...
GuilhE's user avatar
  • 11.8k
1 vote
2 answers
1k views

TextView and EditText cut off in LinearLayout

I have a LinearLayout with horizontal orientation in which I add some TextView and EditText dynamically. My problem is when the TextView is long, it is cut off (by height) and the EditText is ...
tsil's user avatar
  • 2,069
0 votes
0 answers
66 views

Modifying View width without calling requestLayout()

I have a FrameLayout with a 100 views (TextViews). At some point I need to modify the width of 10 views. Calling requestLayout() on 10 children as you know triggers a layout pass of all 100 views and ...
vovahost's user avatar
  • 35.3k
0 votes
1 answer
134 views

Android - Create a view that includes the entire screen

I am not the best at android programming so please correct any errors I make. According to this developer.android.com. Android view is: This class represents the basic building block for user ...
Fish's user avatar
  • 1,687
1 vote
2 answers
109 views

What is convert view in adapters Android

I wonder what is convert view ? I understand that it is The old view to reuse, if possible. Note: You should check that this view is non-null and of an appropriate type before using. If it is ...
dyoordec's user avatar
0 votes
1 answer
217 views

drawing sloped rectangle upper edge shape as in yahoo digest news app using xml android

am trying to draw sloped rectangle upper edge shape and use it as linear layout background as in the picture: here is the link to the design am trying to achieve: http://postimg.org/image/krjwfcisz/ ...
Abdulla Shoshaa's user avatar
2 votes
2 answers
214 views

Android, UI Element in custom View

I'm getting used to creating custom views in android. One thing i wish todo is to include existing UI elements such as EditText, or Switch in my custom view. I have previously developed with Cocoa (...
Simon.'s user avatar
  • 1,886
2 votes
1 answer
793 views

At what point in the View lifecycle should I unsubscribe if the View is never made visible?

I have a View that converts some text to a localised version of that text using an API. This works if the View is visible in the layout because once the View gets destroy onDetachedFromWindow() gets ...
AngusMorton's user avatar

1
38 39
40
41 42
81